Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
add comment

4 Answers 4

up vote 1 down vote accepted

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.

share|improve this answer
    
that's an interesting link, tx –  fduff Jun 29 '12 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 Jun 29 '12 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 Jul 1 '12 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 Jul 17 '12 at 20:55
    
Congratulations on finding your problem, and thanks for marking my reply as answer :) –  SharkWipf Jul 18 '12 at 6:51
show 1 more comment

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.

share|improve this answer
    
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 May 23 '12 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. –  Mikko Rantalainen Oct 12 '12 at 12:01
add comment

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.

share|improve this answer
    
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 May 21 '12 at 13:48
add comment

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 http://unix.stackexchange.com/a/41831/20336.

share|improve this answer
    
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 Jun 29 '12 at 20:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.