5

Normally I do not care much about desktop - performance, since my servers do not run any gui. But at home I run some older hardware (Pentium) which gets sometimes very sluggish (mouse-movements in KDE). I observe that this is the case where there is some disk-io background activity going on.

How can I set that disk-priority lower, so that my gui gets more attention?

I already tried to set the disk-scheduler for my sata-drive from cfq to as - but that did not help.

I remember that I had - long time ago - a similar problem on OpenSuSE - there I set a different general scheduler tick-rate (shorter as default, as far as I remember). But I do not remember what that was exactly, neither how to set that on my current Linux (CentOS 5, 32-Bit).

Any hints are welcome.

5 Answers 5

5

Heard of ulatencyd?

From its README:

== What is ulatency ==

Ulatency is a daemon that controls how the Linux kernel will spend it's resources on the running processes. It uses dynamic cgroups to give the kernel hints and limitations on processes. [...]

== What tries it to fix ==

The Linux scheduler does a pretty good job to give the available resources to all processes, but this may not be the best user experience in the desktop case. ulatencyd monitors the system and categorizes the running processes into cgroups. Processes that run wild to slow down the system by causing massive swaping will be isolated.

If I remember correctly, it in part uses (io)nice underneath. I've never tried it, but if it keeps its promises, it might help you.

More information in its Wiki.

2
  • Sadly I was not able to compile it with CentOS5: CMake 2.8 or higher is required. You are running version 2.6.4
    – Nils
    Commented May 23, 2012 at 20:51
  • I don't know about CentOS but at least with recent Ubuntu versions (12.04+), ulatencyd is available in the official repositories. Commented Oct 12, 2012 at 12:01
1

Do you have a kernel >= 2.6.38? If not, you may want to upgrade your kernel, so it includes "The ~200 Line Linux Kernel Patch That Does Wonders". This patch drastically increases the responsiveness of the Linux desktop. Since this patch was introduced, the only time my desktop was slow was when it was swapping, as Mikko Rantalainen pointed out, even with recent versions of X.

6
  • that's an interesting link, tx
    – fduff
    Commented Jun 29, 2012 at 8:32
  • CentOS5 is a 2.6.18 kernel. But the idea behind this is clever. Perhaps I can achieve the same by building a cpuset for one logical CPU and bind certain processes to it...
    – Nils
    Commented Jun 29, 2012 at 20:09
  • Hmm, that's a possibility, though I suspect compiling your own kernel from kernel.org would be easier. 2.6.18 is quite old already, lots of improvements have been made since, under which many performance improvements. If you are not familiar with compiling a kernel, I can recommend you to check out the kernel compiling chapter from the Gentoo handbook, which pretty much applies to any distro (I would link it, but I only have access to a low-end smartphone atm). You can also make many small performance tweaks this way, by optimizing the kernel for your specific pc.
    – SharkWipf
    Commented Jul 1, 2012 at 0:26
  • I was used to compile kernels when I was younger. Now I think it is not worth the time doing so. I used taskset to pin the system processes with higher PID to one logical CPU, while pinning my user processes to the other logical CPU. Then I was able to pin down the culprit: Firefox is eating my CPU from time to time. Since you got me on that track - you get the accepted answer for this.
    – Nils
    Commented Jul 17, 2012 at 20:55
  • Congratulations on finding your problem, and thanks for marking my reply as answer :)
    – SharkWipf
    Commented Jul 18, 2012 at 6:51
1

You can try using ionice(and go back to cfq, it is faster most of the times), but I don't think that it can do miracles on that kind of old hardware.

I suggest you do a hardware upgrade if you really need to run X and especially KDE on it and expect it to run fine.

1
  • I think I changed the number of millisecondy spent for each subtask - from 1000 to 500. Since my "old" Pentium HT 3 GHz processor is most of the time idle I would expect it to work without multi-cores.
    – Nils
    Commented May 21, 2012 at 13:48
1

Are you sure your system is not swapping? Older versions of X suffered from getting mouse driver swapped out in case system was swapping (I don't understand why but kernel heuristics often decided that the page containing X mouse driver was a good candidate for swapping and next time you move your mouse, the cursor moved only after the page was swapped back in). Newer versions of X lock the mouse driver to memory and do not suffer from this issue.

You might also try to configure the disk for higher throughput/lower latency. See my response to another question at https://unix.stackexchange.com/a/41831/20336.

1
  • No swap issue here. Although old I equipped the machine with plenty of RAM (for its time) - i.e. 2 GB. top shows more than 1 GB as free, swap-usage is zero. And it is not only the mouse that gets stuck. Keypresses are also repeated without end. Your disk-tuning link looks very interesting.
    – Nils
    Commented Jun 29, 2012 at 20:17
1

For what it's worth, I recently went from the standard kernel in Ubunto 3.0.16 to the low latency kernel and the change to my desktop performance was phenomenal. It took some doing because the Nvidia driver included in the Ubuntu distribution would not load with the low-latency kernel however the exact same driver version from Nvidia's website worked fine. Rarely but occasionally I used to have WinAmp (under Wine) skip, no more with the new kernel, and switching virtual desktops is instantaneous now.

1
  • Sounds as if this is exactly the setting that I remember.
    – Nils
    Commented Feb 28, 2015 at 7:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .