Dynamically adapting dnf.conf

Hi there!

By default dnf is excruciatingly slow, at least in comparison to pacman and apk. The slowness of installing and updating packages was my biggest shock when coming to fedora, in a bad way. I wasn’t aware it was possible to tweak this behaviour until recently, and I’ve been using Fedora for more than half a year now. It’s been said the current dnf config is better for / protects low bandwidth users in countries with few or no mirrors.

Instead of providing all users with a slow package management experience out of the box, I suggest we implement logic which adjusts dnf.conf according to a few criteria.


  1. The user is connected to a high throughput/bandwidth network.

  2. The connection is established in a country where mirrors have good capacity.

  3. The network connection is classified as “not rate limited”

  4. /etc/dnf/dnf.conf hasn’t been user edited.

Then set the following parameters in /etc/dnf/dnf.conf:


If the criteria aren’t met, no changes are made to dnf.conf.

This should provide a big lift in UX for users who have great internet connection but aren’t comfortable editing system configuration files, and should provide no downside for other users.

Your thoughts?

fastestmirror=True changes DNF to do client side latency testing of the mirrors after MirrorManager selects them for you anyway. In most cases, the server-side mirror negotiation provides sufficient selection.

max_parallel_downloads=20 will make it so DNF swamps your connection for downloads. That’s probably not great if the user wants to do other things while it downloads stuff.

I have no argument against keeping fastestmirror=False.

max_parallel_downloads=20 may be a bit much for most, but by the same coin max_parallel_downloads=3 is like filling a bathtub using a teaspoon.
If all I have is a teaspoon, then by all means I’ll use it, but if I have a garden hose it would be illogical not to use the hose.

I’m no expert, but isn’t it possible for the computer to detect when the network connection is swamped/congested?
Throttling DNF when the network is swamped/congested seems like a healthier choice than having DNF throttled all the time.

1 Like