DNF dependency resolution latency in multi-repository environments
0 reputation · 24 Apr 2021, 03:55 UTC
0 reputation · 24 Apr 2021, 03:55 UTC
Rocky Linux 9 utilizes a tiered repository structure consisting of BaseOS and AppStream to manage software dependencies. While the distribution maintains application binary compatibility with RHEL, synchronization latency between upstream RHEL repositories and Rocky Linux mirrors can affect the performance of the dependency solver.
When performing complex transactions involving third-party repositories, the DNF package manager must resolve metadata across various sources. This process can encounter a bottleneck during the metadata synchronization phase, particularly when the local metadata cache is stale or when high-latency mirrors delay retrieval of repository metadata files.
Which specific DNF configuration parameters allow granular control of metadata refresh frequency without compromising package-level consistency? Is there a documented method to prioritize BaseOS packages over AppStream during resolution to reduce solver overhead? Are there known limits on concurrent repository metadata downloads that affect resolution time?
34775 reputation · 24 Apr 2021, 13:50 UTC
The DNF parameters that control metadata refresh frequency are metadata_expire (seconds) and metadata_sync (boolean). Repository priority is set with priority= in each .repo file, and concurrent metadata downloads share the max_parallel_downloads limit.
In multi‑repository setups, stale metadata or slow mirrors force DNF to re‑download repodata, increasing solver latency. Third‑party repos add more metadata files, and the solver must evaluate them together with BaseOS and AppStream, which can amplify any delay in metadata retrieval.
metadata_expire defines after how many seconds the local metadata is considered stale; a value of 0 forces a refresh on every command.metadata_sync (when true) tells DNF to synchronize metadata before solving, ensuring the solver sees the newest data.priority=N; lower numbers have higher precedence, so giving BaseOS a lower priority than AppStream makes DNF prefer BaseOS packages when versions are equal.max_parallel_downloads (default 5) for both metadata and package downloads, limiting the number of simultaneous HTTP connections./etc/dnf/dnf.conf (or create a snippet in /etc/dnf/conf.d/) and set:[main]
metadata_expire=3600
metadata_sync=True
max_parallel_downloads=3
/etc/yum.repos.d/rocky-baseos.repo) ensure:[baseos]
name=Rocky Linux $releasever - BaseOS
baseurl=...
priority=1
rocky-appstream.repo) set a higher priority number, e.g. priority=2.dnf clean metadata then dnf update --assumeno to verify that metadata is refreshed according to the new metadata_expire value.dnf repolist -v; the output includes a “Priority” column for each repo.time dnf clean metadata && time dnf makecache and adjust max_parallel_downloads upward if your network allows more concurrent connections.If you are unsure whether the current metadata_expire value is causing the delay, please share the output of grep metadata_expire /etc/dnf/dnf.conf /etc/dnf/conf.d/* so we can confirm whether a lower value is needed.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.