Improving DNF Update Speeds with max_parallel_downloads

2024-10-12 364 words 2 mins read

When managing a Fedora or RHEL-based system, downloading updates can sometimes be time-consuming, especially when dealing with a slow network connection or multiple large packages or sometimes too many small packages 😀. By default, the DNF package manager downloads 1/3 package at a time, which can slow down the process. However, you can significantly improve download times by tweaking the max_parallel_downloads setting.

What is max_parallel_downloads?

max_parallel_downloads is a configuration option in DNF that controls how many packages are downloaded simultaneously during system updates. By increasing the number of parallel downloads, you can take full advantage of your available network bandwidth and reduce the overall time needed for downloading updates.

Changing max_parallel_downloads Setting

To adjust the number of parallel downloads, you’ll need to modify the DNF configuration file located at /etc/dnf/dnf.conf.

  1. Open the configuration file in your preferred text editor:

    1
    
    sudo nano /etc/dnf/dnf.conf
    
  2. Look for the [main] section and add or modify the following line:

    1
    
    max_parallel_downloads=10
    

    This sets DNF to download up to 10 packages simultaneously. You can adjust the number based on your network speed and system performance.

  3. Save the file and exit.

Testing the Performance Boost

After modifying the dnf.conf file, you can run a system update to see the performance improvement:

1
sudo dnf update

During the download process, you should notice multiple packages being fetched simultaneously, reducing the total time spent waiting for updates.

Choosing the Right Number

While increasing the number of parallel downloads can speed up the process, setting the value too high may overwhelm your system’s resources or degrade performance on slower networks. It’s essential to find the optimal balance based on your system’s CPU, memory, and network speed.

  • Slow connections: Try starting with 2-3 parallel downloads.
  • Fast connections: You can increase the value to 10 or more.

You can experiment with different settings to see what works best for your environment.

Conclusion

By tweaking the max_parallel_downloads setting in DNF, you can enhance your system’s performance during updates. This simple optimization allows you to better utilize your network bandwidth, making updates faster and more efficient.

If you haven’t already, give it a try the next time you’re running a system update, and enjoy the time saved!

Related Articles:


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it