Page 1 of 1

Striped LVM Readahead size with KDE4

Posted: Wed Nov 25, 2009 9:07
by sjieke
I have a strange problem using striped lvm volumes in combination with KDE4.

Background info:
I have a 160GB Sata Maxtor HDD with a read speed of +- 55MB/s
I also have a 250GB IDE Maxtor HDD with a read speed of +-30MB/s
Speeds are measured using 'dd' and 'hdparm'
When Sabayon Linux 5.0 KDE came out, I installed it with LVM, to be able to shrink and grow partitions as needed. I was very happy and everything worked out fine.

Recently I found out that you can configure a logical volume to stripe over several disks. So I tried it in the hope to get better read speed for data on the IDE disk. I created a striped logical volume using a stripe size of 1024. Doing my speed tests again I got +-60MB/s. This is the expected result. Me happy again.

Now the problem:
Since I got better speeds using striped LVM, I recreated some logical volumes to striped logical volumes and added them to fstab to be mounted at boot. After rebooting I tested the speed again and got only +-40MB/s instead of +-60MB/s. :(

Doing some investigation and testing got me the following info:
If I boot and go to a tty console, login and check the speed I get +-60MB/s. Using lvdisplay to show some info of the volume I see that readahead is set to auto and the value choosen by the kernel is 8192.
Now I login into fluxbox and everything stays the same.
Logout of fluxbox and login to KDE4. Now the performance degrades to +-40MB/s. Checking lvdisplay again shows that the readahead value is set to 256. Forcing it back to 8192 using blockdev gives me back the 60MB/s speed.

Now the questions:
1) Why, when and how does KDE change the readahead of my logical volumes?
2) Can I prevent KDE from doing this?
3) Can someone using LVM verify this behaviour? Does it also occur using gnome?
4) If I can't prevent KDE from doing this, where can I put the blockdev command to force the readahead back to 8192. The blockdev command needs root privileges and I would like that it is executed for every user. (I tried adding the blockdev command to the local init script, but this executes before the login resulting in no effect (as expected)).

Hoping someone can help me or push me in the right direction by asking some extra info/explenations