Am 15.09.2014 um 21:42 schrieb Christian Boltz:
tried cat $300_mb_file > /dev/null and it took 4 seconds. Why does reading /var/lib/rpm/ (227 MB) take 1:37 minutes (or still 21 seconds after --rebuilddb)?
Because the files are usually fragmented like hell: susi:/var/lib/rpm # shake -vvp .|grep -v alternatives|awk '{print $4" "$5" "$8}' FRAGC CRUMBC NAME 3 0 ./Name 30 5 ./Packages 55 47 ./Basenames 20 13 ./Providename 3 0 ./Obsoletename 8 0 ./Installtid 12 8 ./Requirename 2 0 ./Group 19 4 ./Dirnames 12 5 ./Sha1header 7 0 ./Sigmd5 1 0 ./Triggername 1 0 ./Conflictname 1 0 ./Pubkeys Now I'm not 100% sure what the difference between FRAGC (Fragments) and CRUMBC (Crumbs) in shake's terms is, but high numbers => lots of fragmentation. Not that I'd care anymore, after journald forced SSDs onto all my machines... :-)
Maybe a good workaround would be cat /var/lib/rpm/Packages > /dev/null ; rpm -qa which I expect to be much faster than a simple rpm -qa
No, the problem is the fragmentation, not the bad read pattern of rpm. "cat" will take long and rpm will be faster, overall it will be not much gain. I tried stuff like that before :-)
Yes, this is a serious proposal ;-)
# echo 3 > /proc/sys/vm/drop_caches
cb@geeko:~> time (cat /var/lib/rpm/Packages >/dev/null ; rpm -qa|wc -l ) 3071
real 0m5.837s user 0m1.599s sys 0m0.293s
hm, ok, this contradicts my experience. Well, maybe rpm has gotten worse :-) Have fun, seife -- Stefan Seyfried "Your mail is 7 pages of printout. Do you seriously expect people that do openSUSE in their free time to read that? Little less Castro, little more JFK..." -- coolo -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org