Bug 1878072

Summary: dnf uses 100% cpu when throttle and max_parallel_downloads are set
Product: Red Hat Enterprise Linux 8 Reporter: Sandro Bonazzola <sbonazzo>
Component: librepoAssignee: Jaroslav Rohel <jrohel>
Status: CLOSED ERRATA QA Contact: Jan Blazek <jblazek>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.2CC: james.antill, jrohel
Target Milestone: rcKeywords: Triaged
Target Release: 8.3   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: librepo-1.14.0-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 19:45:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1951407    
Bug Blocks:    

Description Sandro Bonazzola 2020-09-11 09:16:05 UTC
I'm throttling dnf in order to avoid consuming full bandwidth, being a good fellow and sharing my internet connection with my wife which also works from home during this covid19 pandemic.

dnf update is taking 100% of the CPU and with 320MB to download at 200k/s causes my laptop CPU reaching 96°C which makes my keyboard too hot to be used.

No production impact so setting severity to medium but I would be grateful seeing this fixed for 8.3.z

# rpm -qa |grep dnf
dnf-4.2.17-7.el8_2.noarch
python3-dnf-plugins-core-4.0.12-4.el8_2.noarch
python3-libdnf-0.39.1-6.el8_2.x86_64
python3-dnf-plugin-spacewalk-2.8.5-11.module+el8.1.0+3455+3ddf2832.noarch
libdnf-0.39.1-6.el8_2.x86_64
python3-dnf-plugin-versionlock-4.0.12-4.el8_2.noarch
dnf-data-4.2.17-7.el8_2.noarch
dnf-plugin-subscription-manager-1.26.20-1.el8_2.x86_64
dnf-plugin-spacewalk-2.8.5-11.module+el8.1.0+3455+3ddf2832.noarch
python3-dnf-4.2.17-7.el8_2.noarch
dnf-plugins-core-4.0.12-4.el8_2.noarch

# cat /etc/dnf/dnf.conf 
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=True
skip_if_unavailable=False
exclude=redhat-internal-configuser-firststart*
deltarpm=1
throttle=200k
max_parallel_downloads=1

Comment 2 Jaroslav Rohel 2020-12-10 10:55:31 UTC
DNF uses the librepo library to downloading. The problem is in this library. And it affects DNF and other library users.

I prepared a fix: https://github.com/rpm-software-management/librepo/pull/217

Comment 12 errata-xmlrpc 2021-11-09 19:45:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (librepo bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4429