mirror of
https://github.com/aphrody-labs/apt.git
synced 2026-10-14 06:09:01 +00:00
Scale the number of actively used mirrors with the square root of the number of files fetched, using at least three mirrors if enough are available: A handful of files is already spread over a few mirrors and many files are spread over many more (e.g. 4 mirrors for 16 files, 10 for 100), keeping each active mirror roughly equally busy by assigning each file to the currently least used one. Only mirrors with the best (lowest) priority value are candidates, as documented in apt-transport-mirror(1); the remaining mirrors are alternates tried in case of failures. The random order of same-priority mirrors is drawn once per mirror list rather than per item, and the alternates of each redirect are shuffled (keeping their priority) so that different items progress through the failover chain in different orders, spreading failover load across the mirrors. Controlled by Acquire::Mirror::Fanout (sqrt (default) or none, which keeps the previous per-item random choice) and capped optionally via Acquire::Mirror::Fanout-Limit (0 = no limit).