Comments (5)
cpcache uses it's own internal mirrorlist. That means your reflector changes won't affect cpcache. In /etc/cpcache/cpcache.toml
you can define mirrors yourself OR just let cpcache handle it automatically.
For example:
My cpcache config looks something like this:
# ...
# The selection method to choose a mirror. Valid values are:
# "auto": In order to attempt to find suitable mirrors automatically.
# With this method, performance tests are run on the official mirrors
# to select only sufficiently fast mirrors.
# "predefined": To only choose the mirrors defined for the variable
# mirrors_predefined (see below).
mirror_selection_method = "auto"
mirrors_predefined = [
# ...
]
# ...
[mirrors_auto]
# only use mirrors with HTTPS support.
https_required = true
# mirrors must support IPv4.
ipv4 = true
# mirrors must support IPv6.
ipv6 = true
# The maximum score allowed from a mirror. See
# https://www.archlinux.org/mirrors/status/ for an explanation of this
# metric.
max_score = 2.5
# timeout, in milliseconds, when testing the mirrors' performance.
# Mirros which exceed the timeout will not be considered further, regardless
# of their score.
timeout = 500
# If mirrors are chosen automatically, this setting allows to define how
# often the selection process should be repeated. Valid values are positive
# numbers (for instance, 24 to rerun the selection process every 24 hours),
# and -1 to never re-run the selection process.
test_interval = 24
This activates some kind of included reflector, which can be configured as described above. Using this is the best way I know of using cpcache.
On all my machines I have set cpcache's endpoint as the first mirror and have my usual resolver list after that. Defining more mirrors than cpcache is good if you want something to fall back to in case cpcache is offline.
from cpcache.
Great - thank you for the response. Does cpcache refresh the mirrors when the server (re)starts? Also - how many mirrors does it maintain internally?
from cpcache.
As far as I know it does not store this list so it would need to do that on every start. I don't know how many it maintains internally (I am not the developer, I have no idea how this language even works)
from cpcache.
Thanks for your feedback, it's always interesting to hear how others use cpcache.
As described by @Scrumplex, cpcache maintains its own mirrorlist. The whole mirror handling in cpcache is less than ideal, what it currently does is:
- At startup, try to fetch a mirrorlist from https://www.archlinux.org/mirrors/status/json/
- If that fails (which often happens because there is no internet connectivity immediately after startup if cpcache boots with your system), try again after 5 seconds, with 5 attempts in total. If all five attempts have failed, it will see if the json document has been cached from a previous run of cpcache. If that also fails, the five mirrors stored in
mirrors_predefined
in/etc/cpcache/cpcache.toml
are used as fallback (I just noticed that some of the mirrors defined in the toml file are not even active anymore…) - When the json document has been fetched successfully, test the latency of all mirrors that match the given criteria (the ones defined in
[mirrors_auto]
in your/etc/cpcache/cpcache.toml
). These mirrors are then sorted by latency.
This list is not stored, it's re-generated after each start. For each download, it tries each mirror in this list one after another until there are none left, then it returns 404 to the client.
In instances where a package updates, such as i3-gaps yesterday, cpcache couldn't find the package and the client machine was getting 404 errors. I updated the mirrorlist of 50 on the cpcache server and restarted, but I still couldn't get the package.
This was most likely a bug in cpcache, but it's difficult to say what caused it exactly. I've been meaning to revamp the whole mirror selection process for some time, hopefully I'll get around to it this weekend and hopefully, this will fix your issue.
from cpcache.
Thanks for the explanation. Understanding how it works will help place it into my workflow correctly. Thanks again!
from cpcache.
Related Issues (20)
- Downloads sometimes stall for small files HOT 2
- archlinux.org mirror list is a single point of failure
- Log download info in dets: Which files have been dowloaded, and how?
- Connection to remote mirror interrupted when other clients are still downloading
- Speed limit for :dev and :test environment applied for :prod HOT 2
- Improve mirror selection process HOT 2
- Listen both on 127.0.0.1 as well as ::1
- Refactor HTTP Server functionality into separate module
- Use Elixir releases
- Re-organize test cases, use tags
- Consider using mint instead of hackney HOT 3
- Package from AUR not building HOT 1
- Possible to use add AUR builds to cache? HOT 8
- Resolve HTTP 500 errors caused by bumping eyepatch version HOT 6
- Unable to fetch mirror data HOT 2
- ARM clients? HOT 3
- Custom timeout for clients HOT 4
- Remove hardcoded mirrors in toml file
- Swap mirror during download when too slow
- Re-using connections
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpcache.