performance issue reading in from an rpmdb

November 10, 2011

If you find all rpm and yum operations EXTREMELY slow – even doing  simple things like listing all installed pkgs – it would be handy to take a look at the numbers you’re getting.

A bug filed today:

https://bugzilla.redhat.com/show_bug.cgi?id=752897

 

has been able to replicate it.

 

However, if you would like to check it on your system in general please run:

time python -c ‘import yum; print len(yum.YumBase().rpmdb.simplePkgList())’

This will spit out a number and then some times. The times are obvious – the number is the total number of pkgs installed on your system  – according to your rpmdb.

If the time is beyond like 20s it’s way too slow. On my laptop it is between .12s and .78s.

Seriously – it shouldn’t take very long at all. if it is taking a long time – post your numbers in a comment on this blog post and what ver of rpm you’re using.

thanks

 

 

About these ads

13 Responses to “performance issue reading in from an rpmdb”

  1. Andre Costa Says:

    Hi Seth,

    fortunately, it seems to be ok on my system. BTW: probably doesn’t matter, but I did a fresh install instead of upgrading from F15.

    ~ time python -c “import yum; print len(yum.YumBase().rpmdb.simplePkgList())”
    Loaded plugins: langpacks, presto, refresh-packagekit
    1347

    real 0m0.248s
    user 0m0.144s
    sys 0m0.035s

    ~ rpm -q rpm
    rpm-4.9.1.2-1.fc16.x86_64

  2. xose.vazquez@gmail.com Says:

    # time python -c ‘import yum; print len(yum.YumBase().rpmdb.simplePkgList())’ ; rpm -q rpm
    Loaded plugins: fastestmirror, langpacks, presto, priorities, refresh-packagekit
    2253

    real 0m0.579s
    user 0m0.466s
    sys 0m0.112s
    rpm-4.9.1.2-1.fc15.x86_64

  3. skvidal Says:

    if your numbers are less than 1s then I think that’s just fine :)

  4. Bradley Baetz Says:

    Did it twice:

    $ time python -c ‘import yum; print len(yum.YumBase().rpmdb.simplePkgList())’
    Loaded plugins: auto-update-debuginfo, priorities, refresh-packagekit,
    : versionlock
    2652

    real 0m46.768s
    user 0m2.275s
    sys 0m1.091s
    $ time python -c ‘import yum; print len(yum.YumBase().rpmdb.simplePkgList())’
    Loaded plugins: auto-update-debuginfo, priorities, refresh-packagekit,
    : versionlock
    2652

    real 0m1.222s
    user 0m0.989s
    sys 0m0.219s

    Did “echo 3 > /proc/sys/vm/drop_caches” as root and it went to 1m29s

    /var/lib/rpm is 304M

    This is a RAID1 setup with a 4 core AMD processor and 4G of RAM.

  5. skvidal Says:

    1m29s seems high… to me – is that on f16? If so could you add your info to that bug report?
    thanks

  6. Bradley Baetz Says:

    BTW, this is F15 (I missed that this was F16).

    rpm –rebuilddb takes the size down to 137M and then (after drop_caches) 58sec

  7. Ben Says:

    Loaded plugins: auto-update-debuginfo, langpacks, presto, refresh-packagekit
    1900

    real 0m14.861s
    user 0m0.390s
    sys 0m0.316s

    /var/lib/rpm is 208M (according to du -su)
    Running Fedora 16.

  8. Scott Dowdle Says:

    Loaded plugins: langpacks, presto, refresh-packagekit
    1933

    real 0m2.202s
    user 0m0.664s
    sys 0m0.188s

    Fedora 16 with rpm-4.9.1.2-1.fc16


  9. Fedora 16 264M /var/lib/rpm

    2402

    real 0m16.238s
    user 0m1.099s
    sys 0m0.533s

  10. Janos Virágh Says:

    $ rpm -qi rpm|head -4
    Name : rpm
    Version : 4.9.1.2
    Release : 1.fc15
    Architecture: i686
    $ uname -a
    Linux xxx 2.6.40.6-0.fc15.i686.PAE #1 SMP Tue Oct 4 00:44:38 UTC 2011 i686 i686 i386 GNU/Linux
    $ time python -c ‘import yum; print len(yum.YumBase().rpmdb.simplePkgList())’
    Loaded plugins: fastestmirror, langpacks, local, presto, priorities, refresh-
    : packagekit
    2242

    real 0m0.384s
    user 0m0.284s
    sys 0m0.096s

  11. Shawn Starr Says:

    rawhide:

    [root@segfault ~]# time python -c ‘import yum; print len(yum.YumBase().rpmdb.simplePkgList())’
    Loaded plugins: auto-update-debuginfo, fastestmirror, langpacks, presto,
    : refresh-packagekit, rpm-warm-cache, upgrade-helper
    2318

    real 0m54.300s
    user 0m1.193s
    sys 0m0.832s

    And again (cached!)

    [root@segfault ~]# time python -c ‘import yum; print len(yum.YumBase().rpmdb.simplePkgList())’
    Loaded plugins: auto-update-debuginfo, fastestmirror, langpacks, presto,
    : refresh-packagekit, rpm-warm-cache, upgrade-helper
    2318

    real 0m0.224s
    user 0m0.147s
    sys 0m0.043s

  12. Shawn Starr Says:

    Fedora 15 -> 16 preupgrade box:

    [root@coredump ~]# time python -c ‘import yum; print len(yum.YumBase().rpmdb.simplePkgList())’
    Loaded plugins: fastestmirror, presto, refresh-packagekit
    1943

    real 0m43.152s
    user 0m2.411s
    sys 0m1.896s

    And again (cached!)

    [root@coredump ~]# time python -c ‘import yum; print len(yum.YumBase().rpmdb.simplePkgList())’
    Loaded plugins: fastestmirror, presto, refresh-packagekit
    1943

    real 0m0.377s
    user 0m0.307s
    sys 0m0.060s

  13. thm Says:

    # sync ; echo 3 > /proc/sys/vm/drop_caches
    # time python -c ‘import yum; print len(yum.YumBase().rpmdb.simplePkgList())’
    Geladene Plugins: auto-update-debuginfo, etckeeper, langpacks, presto,
    : priorities, refresh-packagekit
    4635

    real 0m25.042s
    user 0m0.699s
    sys 0m0.520s

    # rpm -q rpm yum
    rpm-4.9.1.2-1.fc16.x86_64
    yum-3.4.3-7.fc16.noarch


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: