You are not logged in.

#1 2010-11-14 05:43:53

MkFly
Member
From: Mars
Registered: 2009-12-10
Posts: 141

[SOLVED] Pacman reading database is sloooowww ...

Running Arch on my ThinkPad, when I -Syu, I usually get something like this:

$ time pacman -Syu
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
:: Starting full system upgrade...
 there is nothing to do

real    1m29.062s
user    0m0.560s
sys     0m0.610s

It gets to Starting full system upgrade within a few (3 or 4) seconds, and then spends the rest of its time there.  During that time, my hard drive activity light is going, but my drive is quite fast, being a 7200RPM Scorpio Black.  When I ran Arch on an old Dell laptop (with my same home network connection and using the same mirrors), I would usually complete the same operation within 5-10 seconds.

I don't think it's a network issue -- it happens on different wireless networks that I connect to, and I've tried a number of different mirrors.  When I do install a package, it usually downloads at around 200-500KB/s, so that part is actually quite fast.  My /var partition is ext4.

I've done pacman -Sc and pacman-optimize, which hasn't helped.  I also run Arch on my Linode VPS (and yes I realize they are using faster drives than I have), but the same operation there completes with real 0m0.494s.

Anybody have any idea why it's this slow?

Last edited by MkFly (2010-11-14 18:23:25)

Offline

#2 2010-11-14 05:51:57

flamelab
Member
From: Athens, Hellas (Greece)
Registered: 2007-12-26
Posts: 2,160

Re: [SOLVED] Pacman reading database is sloooowww ...

Have you tried

pacman -Syy

to see if that fixes that problem ?

Offline

#3 2010-11-14 06:06:33

MkFly
Member
From: Mars
Registered: 2009-12-10
Posts: 141

Re: [SOLVED] Pacman reading database is sloooowww ...

flamelab wrote:

Have you tried

pacman -Syy

to see if that fixes that problem ?

Hadn't thought of that -- just gave it a try, didn't help. sad

Something I noticed: on a fresh boot, it takes this long amount of time.  After that, it's as quick as it should be (2-5 seconds), unless I wait a while (say, more than 10 minutes) and try it again, in which case it's slooooww again.  Also, this doesn't just happen with -Syu, it's slow like this for pretty much everything (-Ss, -Qs, -Ql, -Qo, -Qi, etc.)

Offline

#4 2010-11-14 06:07:06

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [SOLVED] Pacman reading database is sloooowww ...

Offline

#5 2010-11-14 08:36:54

MkFly
Member
From: Mars
Registered: 2009-12-10
Posts: 141

Re: [SOLVED] Pacman reading database is sloooowww ...

Thanks.  pacman-cage is a BIG help:

$ time pacman -Syu
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
:: Starting full system upgrade...
 there is nothing to do

real    0m4.142s
user    0m0.323s
sys     0m0.360s

So, is the underlying cause that the all of those files in the database are stored non-contiguously?

Last edited by MkFly (2010-11-14 08:37:07)

Offline

#6 2010-11-14 09:09:07

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,520
Website

Re: [SOLVED] Pacman reading database is sloooowww ...

Yes...   with pacman-3.4, only new database entries from the sync db were extracted.  That was a big speed up, but caused the sync database to be spread across the filesystem, so caused long term slow down.

With pacman-3.5, we now read the sync dbs directly from the tarballs that are downloaded so no fragmentation there.   Also, the local database may get somewhat more fused, with the "depends" and "desc" files being merged together.  Overall, pacman-3.5 will show a very noticeable speed up.

Offline

#7 2010-11-15 22:21:03

MkFly
Member
From: Mars
Registered: 2009-12-10
Posts: 141

Re: [SOLVED] Pacman reading database is sloooowww ...

Allan wrote:

Yes...   with pacman-3.4, only new database entries from the sync db were extracted.  That was a big speed up, but caused the sync database to be spread across the filesystem, so caused long term slow down.

With pacman-3.5, we now read the sync dbs directly from the tarballs that are downloaded so no fragmentation there.   Also, the local database may get somewhat more fused, with the "depends" and "desc" files being merged together.  Overall, pacman-3.5 will show a very noticeable speed up.

Thanks Allan.

Offline

#8 2010-11-16 23:46:18

Fruity
Member
Registered: 2009-12-16
Posts: 198

Re: [SOLVED] Pacman reading database is sloooowww ...

Wouldnt pacman-optimize help too?

Offline

#9 2010-11-16 23:53:58

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,520
Website

Re: [SOLVED] Pacman reading database is sloooowww ...

The idea behind pacman-optimize is to move all your database files to one continuous block on the hard-drive.  That is the theory...  in practice there may be a different story.

Offline

Board footer

Powered by FluxBB