Skip to content

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.

13 points4 comments
Open on Reddit
About this post
Posted
Archived
Score
13 · 93% up
Kind
Text
ID
mx8f5m

Author

3
posts
197
comments
0
media
View profile

4 comments

just a note and an anecdote:

there used to be a script called pacman-optimize that 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 bash after dropping cache (had ran a defrag on the partition). after "optimizing" i can do 5s after dropping cache.

4 points

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.

pacman-optimize is placebo. All files end up in your cache afterwards, so it looks fast...

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.

5 points

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).

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.