Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1133330

Summary: dnf takes 60-100% cpu while downloading packages
Product: [Fedora] Fedora Reporter: Andy Lutomirski <luto>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: akozumpl, jsilhan, kdudka, luto, packaging-team-maint, pnemade, rholy, tla, tmlcoch
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-26 09:05:02 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: 1166239    
Bug Blocks:    
Attachments:
Description Flags
LIBREPO_DEBUG=1 output none

Description Andy Lutomirski 2014-08-24 17:07:02 UTC
Even when dnf is just downloading packages, it seems to take a lot of CPU time.  This makes my laptop sad.  Is it easily fixable?

Comment 1 Honza Silhan 2014-08-26 09:05:02 UTC
Hi, I haven't noticed more CPU consumption during downloading. How does yum perform on your laptop? Is is happening with deltas or regular packages? Closing this. If another user experience the same problem and I would be able to reproduce it, then I will reconsider this issue.

Comment 2 Andy Lutomirski 2014-11-07 05:49:27 UTC
I haven't checked yum lately, but this is 100% reproducible for me.  I think it's caused by:

https://github.com/Tojaj/librepo/issues/34

Comment 3 Jan Zeleny 2014-11-07 07:38:36 UTC
Based on comment 2, I'm adding Tomas to CC to take a look at this.

Comment 4 Tomas Mlcoch 2014-11-07 12:53:05 UTC
Hi Andy,
I've commented on the issue on github [1].

I have a few questions:

1. What version of librepo and related libraries are you using just now?
(e.g. $ rpm -q dnf librepo libcurl)

2. What type of connection are you using and what speed?

3. Could you please provide a librepo debug output from a run that was affected by this issue?
(e.g. $ sudo LIBREPO_DEBUG=1 dnf update 2>&1 | tee librepo.debug.out)

ad 2. I think that such high load could be justifiable in case you have high speed internet connection (e.g. 100Mbps) and you are downloading from a close mirror that serves you data with that speed.

Regards
Tomas

[1] https://github.com/Tojaj/librepo/issues/34#issuecomment-62120477

Comment 5 Andy Lutomirski 2014-11-07 16:24:04 UTC
$ rpm -q dnf librepo libcurl
dnf-0.5.4-2.fc20.noarch
librepo-1.7.5-1.fc20.x86_64
libcurl-7.32.0-14.fc20.x86_64
libcurl-7.32.0-14.fc20.i686

I'm on a 7 Mbps connection or so on a Sandy Bridge laptop that should be able to handle that kind of throughput without much effort.  It's a fast wireless link, and the bottleneck is the router on the other end that's running fq-codel.  (It would be very slightly faster but with much higher latency if I turned off the shaping.)

Comment 6 Andy Lutomirski 2014-11-07 16:24:43 UTC
Created attachment 955004 [details]
LIBREPO_DEBUG=1 output

Comment 7 Tomas Mlcoch 2014-11-20 15:13:14 UTC
Thanks for all the effort!
I guess the issue could be related to this bug in Curl [1]
(Related librepo issue on github: [2]).
The curl bug is fixed now [3], but the version of curl (7.38.0) that contains the fix is not available in fedora yet.

[1] http://curl.haxx.se/mail/lib-2014-06/0242.html
[2] https://github.com/Tojaj/librepo/issues/31
[3] https://github.com/bagder/curl/commit/cacdc27f52ba

Comment 8 Tomas Mlcoch 2014-11-20 15:14:42 UTC
Kamil, would it be possible to include the patch [3] into Fedora's libcurl?

[3] https://github.com/bagder/curl/commit/cacdc27f52ba

Comment 9 Kamil Dudka 2014-11-20 15:42:10 UTC
(In reply to Tomas Mlcoch from comment #8)
> Kamil, would it be possible to include the patch [3] into Fedora's libcurl?
> 
> [3] https://github.com/bagder/curl/commit/cacdc27f52ba

Sure thing.  Just reassign/clone this bug for curl.  I will take care of that.