Bug 474492 - yumbackend.py likes to take all my CPU power
yumbackend.py likes to take all my CPU power
Product: Fedora
Classification: Fedora
Component: PackageKit (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Richard Hughes
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-12-03 20:24 EST by Mark
Modified: 2014-01-21 18:07 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-01-14 08:32:52 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Mark 2008-12-03 20:24:03 EST
Description of problem:
I just was watching top when my system got very slow.
It turned out that yumbackend.py was using all resources that where left!

Version-Release number of selected component (if applicable):
current version in Fedora 10:

How reproducible:
don't know

Steps to Reproduce:
Actual results:
yumbackend.py started running to do.. something.. and to get silent after again after a few second of taking all my resources

Expected results:
i shouldn't notice yumbackend.py! it shouldn't be noticable that yum is doing something in the background.

Additional info:
This is probably not a bug but just programmed to do something lets say once a hour. There probably isn't a CPU limit set on yumbackend.py. My CPU is a intel dual core T5200 1.6 GHz (acer aspire 5630 notebook)

My suggestion:
I would like to suggest to let yumbackend.py ONLY run when the system is using few resources or is idle. Also i would like to suggest that yumbackend.py is limited to a max of 20% of cpu power. I have no clue how you can do something like that but it should (right?) be possible in python.
Comment 1 seth vidal 2008-12-04 00:22:12 EST
Not really reassinging but asking for input.

Richard, Tim,
  Does it make sense to nice-out the time that any of the pk backends get?
Comment 2 Richard Hughes 2008-12-04 04:20:46 EST
I guess what the reporter is experiencing is either the auto-get-updates or maybe the auto-cache-refresh code, although the latter is unlikely as that only happens when idle for a while.

I don't think it makes sense to kill a job just because it's taking a long time, although I do think it would be good to CPU limit this check if possible. I don't know how to do that in python.

Comment 3 Mark 2008-12-04 08:13:17 EST
For more info (in case that wasn't clear) i'm using a fairly default fedora installation + the rpmfusion repo. i haven't changed any yum settings. The install was from the Fedora DVD (not the live CD)

@richard, i have no idea which one of "auto-get-updates" and "auto-cache-refresh".. is there any yum log somewhere where i can check that? the yum.log file is not telling me anything about yumbackend.py
Comment 4 Richard Hughes 2008-12-04 09:44:42 EST
yumbackend is run from PackageKit, to interface with yum. You can get all the details about what was done, why whom, and why, by doing this command "pkcon get-transactions"

this produces a few screenfulls of:

Transaction: /914_caebcbce_data
 System time: 2008-12-03T08:37:22.786753Z
 Succeeded: True
 Role: update-system
 Duration: 599 (seconds)
 Command line: gpk-update-viewer
 User ID: 500
 Username: hughsie
 Real name: Richard Hughes
 Affected packages:
 - downloading samba-client-3.2.5-0.23.fc10.i386
 - updating selinux-policy-3.5.13-26.fc10.noarch
 - updating selinux-policy-targeted-3.5.13-26.fc10.noarch
 - updating samba-3.2.5-0.23.fc10.i386
 - updating libsmbclient-3.2.5-0.23.fc10.i386
 - cleanup samba-common
 - cleanup wine-ldap
 - cleanup gtkhtml3
 - cleanup qt-x11
Comment 5 Mark 2008-12-04 11:14:56 EST
I'm getting a strange output..
My last "transaction" was according to the line you gave me:

[mark@localhost ~]$ pkcon get-transactions
Transaction  : /6_abbbdbeb_data
 timespec    : 2008-12-02T01:28:59.262586Z
 succeeded   : 1
 role        : install-packages
 duration    : 0 (seconds)
 data        : downloading	tinyxml;2.5.3-3.fc9;x86_64;fedora	A simple, small, C++ XML parser
downloading	wxBase;2.8.9-1.fc10;x86_64;fedora	Non-GUI support classes from the wxWidgets library
downloading	filezilla;;x86_64;updates	FileZilla FTP, FTPS and SFTP client
downloading	wxGTK;2.8.9-1.fc10;x86_64;fedora	GTK2 port of the wxWidgets GUI library
installing	wxBase;2.8.9-1.fc10;x86_64;fedora	Non-GUI support classes from the wxWidgets library
installing	wxGTK;2.8.9-1.fc10;x86_64;fedora	GTK2 port of the wxWidgets GUI library
installing	tinyxml;2.5.3-3.fc9;x86_64;fedora	A simple, small, C++ XML parser
installing	filezilla;;x86_64;updates	FileZilla FTP, FTPS and SFTP client

Which is not right. The transaction itself is fine but there should be more. i did a yum -y install updates yesterday which downloaded and installed for about 170 MB of updates but that's nowhere to be found in the transactions. All other transactions are from last month (november)
Comment 6 Richard Hughes 2009-01-14 08:32:52 EST
commit 491c1c887abd42c282ee8277bc65456be616577b
Author: Adel Gadllah <adel.gadllah@gmail.com>
Date:   Wed Dec 17 17:55:22 2008 +0100

    Don't let spawned backends hog the disk by default

:100644 100644 d94ce75... 56c8836... M	etc/PackageKit.conf.in
:100644 100644 601ed7d... 4553a21... M	src/pk-spawn.c
:000000 100644 0000000... c2b9e96... A	src/pk-sysdep.c
:000000 100644 0000000... c453e29... A	src/pk-sysdep.h
Comment 7 Alfred Reaud 2009-12-10 19:20:36 EST
I've got an issue where I execute "yum update" after "yum check-update" and yum appears to hog all the computer resources, the hard disk starts thrashing, and the user is locked out of normal Gnome window functions such as scrolling, opening new applications, switching virtual terminals, etc.

Upon examination with gnome-system-monitor, one sees that the kernel and user cpu use is minimal to moderate, in the 10%-30% range, but the IO waits are between 70% and 90%. This is using the panel display of gnome-system-monitor. There is no network activity at this time. The problem occurs regardless of whether you use yum from the command line or PackageKit from Gnome. The problem occurs regardless of whether you're installing or removing packages.

Some data - 
Host: Windows XP SP3
VM: VMware 7
Client: Fedora 12
Kernel: vmlinuz-
yum: yum-3.2.25-1.fc12.noarch

Note You need to log in before you can comment on or make changes to this bug.