2

On Linux, how to make the processes remember their nice between starts ?

For XP+ you can use Prio to remember the priority and also the IO priority on VISTA+. However, on Linux, and only for running via terminal, I've had to create a command in /etc/bash.bashrc. Changing a shortcut works too, but you can't create endless count of them.

2 Answers 2

0

I don't really think you can. I have a shortcut / bash script that renice's itself and then launches the executable associated with it. I generally don't have too many processes that I have to renice (just my minecraft server), so I haven't found it to be too big of an issue.

#!/bin/sh
renice 4 -p $$
mono McMyAdmin.exe

and then I just run the script instead of the executable I usually would.

1
  • Accepted as an answer, for the script. Someone really should make something like Prio. Can't be that hard for a Linux coder. Commented Jan 13, 2012 at 18:20
0

For the few commands you may run frequently that you want niced, you can alias the command in your .bashrc file. This can be overridden if you want to run without nice.

In years of working with Unix and Linux, I haven't needed to run many programs using nice. Most of those I don't want niced all the time. The scheduling model on Unix works well in most cases without it.

Most of the programs that I do want niced all the time have a mechanism already. I run BOINC to share spare CPU cycles with various research projects. It is automatically niced, and has options to stop working when there is a heavy load.

There are some batch jobs I want niced. They tend to be scripted, so it is easy to add the nice command to the beginning of the command line.

If I do fire up a lot of processes at once, I may renice some processes. Now that ionice is available, I have had occasion to use it on a running process, but it is not something I routinely do.

You must log in to answer this question.

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