Reply to topic

Improve KDE start times using loop-mounted filesystems

Gullible Jones
Registered Member
Posts
121
Karma
0
OS
If you like KDE, but are annoyed by its long startup times (especially after a cold boot), then you might want to try this. YMMV, as with all things, but for me it made startup a lot faster.

1. Enter runlevel 3, or otherwise turn off your login manager.

2. Create two empty files, 32M each. This can be done with dd, but is better done with fallocate if you're using ext4 or XFS:
# fallocate -l 32M /loop_tmp
# fallocate -l 32M /loop_var_tmp

3. Format them as ext2.
# mke2fs /loop_tmp
# mke2fs /loop_var_tmp

4. Add the following fstab entries for them:
/loop_tmp /tmp ext2 noatime,nodev,nosuid 0 2
/loop_var_tmp /var/tmp ext2 noatime,nodev,nosuid 0 2

5. Mount all filesystems:
# mount -a

6. Correct the permissions on the newly mounted directories:
# chmod 1777 /var/tmp
# chmod 1777 /tmp

7. Restart your login manager, and log into KDE.

Obviously this works by reducing disk I/O delay. With most KDE temp stuff confined to two contiguous 32 MB areas, instead of being scattered all over the disk, startup will (hopefully) be faster; especially as 32 MB is a tiny area on a modern hard disk.

Caveats:
- I don't know how to do anything like this on *BSD. If you do know how, please comment.
- I've only tested this on Slackware 13.37 with KDE 4.5.5. It may be less effective, or entirely ineffective, on earlier or later KDE versions.
- Obviously, putting large stuff in /tmp will not be possible after doing this. I'm pretty sure it's "against the rules" for programs to stick hundreds of MB of stuff in /tmp, but not all programs follow the rules.
- Finally, it is doubtful that this will work on an SSD. It might even be harmful in some weird non-obvious way.
Gullible Jones
Registered Member
Posts
121
Karma
0
OS
And an addendum: it seems this will not work on KDE 4.8, and probably other versions, because the plasma theme cache in /var/tmp/kdecache-$USER is too big to fit in the loop-mounted FS.
User avatar bcooksley
Administrator
Posts
18657
Karma
83
OS
If you use an area larger than 32mb (say 256mb) for each one, then this technique should still be workable under KDE Trunk. No idea how this affects the performance though.


System Settings and Device Actions KCM maintainer
Image
Gullible Jones
Registered Member
Posts
121
Karma
0
OS
bcooksley wrote:If you use an area larger than 32mb (say 256mb) for each one, then this technique should still be workable under KDE Trunk. No idea how this affects the performance though.


Thanks. Unfortunately the performance impact appears to be negative with KDE 4.8 and 256 MB filesystems - my hot startup time went from 20 to 40 seconds. Not sure what would account for that...

But this is, at any rate, a cheap trick. It seems to me that the real problem is Plasma incorporating everything but the kitchen sink by default.

 
Reply to topic

Bookmarks



Who is online

Registered users: alake, Alexa [Bot], Baidu [Spider], Bing [Bot], bobo01, einar, Exabot [Bot], Google [Bot], Hei Ku, joshaughnessy, Marand, mgraesslin, nezumi, orbmiser, TheraHedwig, Yahoo [Bot]