For anybody still siphoning wiggly bits off platters
Turns out pacman keeps its installed-package db as a filesystem tree something like apt does, so over time the inode numbering can get scattered and the seeks while scanning can slow some pacman ops.
sudo sh -ex <<\EOD
cd /var/lib/pacman/local
find | sort | cpio -pd ../new
cd ..
mv local local.old
mv new local
sync -f local
rm -rf local.old
EOD
makes e.g. the package integrity checks seem to go lots quicker in my smoketests (which did do sudo tee /proc/sys/vm/drop caches<<<3 first). I can't do better than smoketests for at least a few months because I didn't preserve the original local dir anywhere.
About this post
- Posted
- Archived
- Score
- 13 · 93% up
- Kind
- Text
- ID
- mx8f5m
4 comments
just a note and an anecdote:
there used to be a script called
pacman-optimizethat did this. it was removed when contrib/ moved to pacman-contrib, because it wasn't seen as useful.i'm hesitant to say that i still have use for the method. i have one machine with a packed xfs drive that was just running 20s for
pacman -Qi bashafter dropping cache (had ran a defrag on the partition). after "optimizing" i can do 5s after dropping cache.Wow is that a harsh dismissal at that link. wtf. What, he has his system always up and his maintenance automated and never has to wait for pacman to check things? Something.
… and that's not all.
from the same guy, found by further digging, is simply wrong. Maybe he's got /var on some filesystem that avoids this problem?
From my debian days, its equivalent of this was only worth running maybe twice, three times a year, I wouldn't expect this to be worth it more than that.
Allan definitely knows what he's talking about, so it makes me think i'm just missing something (especially with the insult heh).
but it's still relevant for me... and i really can't see how it wouldn't work as prescribed (unless you end up writing back the same fragmentation for some reason).