Page 1 of 1

[DONE] Question about urpmi startup times

PostPosted: May 15th, '18, 20:39
by ITA84
I've been meaning to ask about this for a while: when using any urpmi command (or drakrpm) for the first time after a reboot, I always experience a long startup time (about 2 or 3 minutes) with intense HDD usage, whereas any subsequent urpmi command before the next reboot is fast (a few seconds even for an auto-select). Is this normal? I've always assumed it is, but had some doubts.
I've tried running a command with some rebug flags (urpmi --verbose --debug --debug-librpm --auto-update), and the part of the output where it's taking the longest is
Code: Select all
getting exclusive lock on rpm
opening rpmdb (root=, write=)
D: opening  db environment /var/lib/rpm cdb:0x401
D: opening  db index       /var/lib/rpm/Packages 0x400 mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D:  read h#   51690 Header sanity check: OK
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm
scheduled sets of transactions:
I pacchetti sono aggiornati
unlocking urpmi database
unlocking rpm database
EXITING (pid=2052)

where '...' is the read h# line repeated hundreds of times with different numbers.
Thanks in advance

Re: Question about urpmi startup times

PostPosted: May 16th, '18, 18:32
by doktor5000
Well, it needs to reads the database of installed packages (/var/lib/rpm/Packages) so depending on the number of installed packages that may take a while.

But 2 or 3 minutes does not sound like a reasonable time, and I've also never noticed it taking longer on the first run, but that might be natural behaviour as it needs to read the file, afterwards that data will be cached so it won't take that long.
Although if those 2 or 3 minutes also include the time waiting to update your repos against the mirror servers, or for drakrpm the time it takes to sort the packages into categories (you can rule out that part by only using urpmi) then that might be normal depending on what mirrors you use, how many repos, your internet connection, latencies and mirror load at that time.

Although you could still try to run rpm --rebuilddb and measure again against a "clean" rpm db.

Re: Question about urpmi startup times

PostPosted: May 16th, '18, 21:41
by ITA84
I've checked again: an 'urpmi --auto-select' takes about 1 minute and a half (when there's just one new package) the first time. Then I've run rpm --rebuilddb as you suggested (ran it twice in a row, because the first time it said 'errore: could not delete old database at /var/lib/rpmold.3461', but there was no such file or directory there) and rebooted: this time the same command took 15 seconds!
I wonder if there was something wrong with my DB, although I'm pretty sure I'd tried try rebuilddb in the past and nothing changed. I'll keep watching my update times.
Thanks for your help!

Re: Question about urpmi startup times

PostPosted: May 16th, '18, 23:28
by doktor5000
Please mark the thread accordingly by editing the topic of the first post and prefix it by [DONE], thanks