[Google]

Linux’s scheduler is rubbish

Alright the scheduler is not rubbish, but it has some limits that are frustrating for a single user desktop system.

A normal user can not increase the priority of any process, although they can decrease it. The most insane part is that after decreasing you can’t even reset it back to what it was before without root priviliges. If I want mplayer to play a video without skipping while doing a video conversion and compressing some files in the background I have to remember to renice the latter two programs before starting the video.

Now I understand the reasons behind this, linux is a multi-user system and if one user is allowed to increase his processes priority higher than other peoples then that user can start hogging the system. There has to be a reasonable middle ground though, I don’t want to steal resources from other users (there aren’t actually any other users on my systems mind). I just want mplayer to have priority over bzip2, and the only way to achieve that is to go through every process other than mplayer and renice it. Not very practical.

There is a program called and (auto nice daemon) that helps somewhat by automatically dropping the priority of programs that use more than a set amount of cpu time. You can set up various conditions so it treats different programs differently, so I have mplayer set to never drop and some long running programs to drop to 19 as soon as and kicks in. It’s not a perfect solution though as it takes at least a couple of minutes for a new process to hit the threshold, during which time the original problem is still there.

I want a system where I can set the default nice level for my programs to be lower than normal (say nice 5) and then set specific programs to run at the original level (nice 0). If there are other users in the system I won’t be stealing cpu from them unless they have also set their default nice level to a lower level too, in which case we are no worse off than before.

There is a related problem also, namely that there is no way to set a program to use no cpu unless no other program wants any. Even the lowest possible priority program will still use some cpu time. This meant that whenever I was doing a really long running cpu intensive task, like a big video conversion for example, I had to remember to stop seti@home because not doing so could add an hour or more to the time the video conversion would take. What I wanted was to set seti to only run if absolutely nothing else was asking for cpu time, but there seems to be no way to do that :-( .

I think the linux scheduler needs a fundamental revamp to take into account the needs of a modern desktop system. I can only hope there are some kernel devs out there who think the same ;-) .

Related Posts

No related posts.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Additional comments powered by BackType