Tag Info

Hot answers tagged

14

Since linux 2.6.12, that depends on the value of the RLIMIT_NICE limit (ulimit -e). Which can take values from 0 to 40. That limit is more the limit on the priority of the process (the greater that number, the higher the priority a user can set for a process). You'll notice the default value is 20 on ubuntu 10.04 and 0 in Debian jessie for instance. A ...


14

It's for what I'd call policy reasons. The idea is that normal users can't override the actions of privileged users. Let's say you're a user on some enormous shared server. You're running monstrous CPU-hogging processes to the detriment of the other users. The sysadmin renices some of your processes because he doesn't like you very much. The OS doesn't ...


10

Disk and memory scheduling are entirely different. In the absence of an IO priority scheduler, IO will be handled on a first come first served basis. If the system is IO bound, then all processes run in a more or less round robin basis until all are waiting for I/O. The nice priority of a process will have little impact on its scheduling frequency. ...


10

To set niceness (CPU bound) use nice. To set IO niceness (IO bound) use ionice. Refer to the respective man pages for more information. You can use them together as follow: ionice -c 2 -n 0 nice -n -20 mplayer Note: the lowest level of niceness (lower means more favorable) you can define is determined by limits.conf. On my computer the file is located at ...


10

Reniceing the process group to -20 is a bad idea. This niceness level should be used only by the top-priority system-critical tasks. Otherwise you can loose responsiveness or even freeze the system. And the potential compilation-time benefit would be marginal. Apart from what Caleb already suggested, if you compile a lot, you can also speed up builds using ...


8

I would start it normally and use "renice" afterwards... However I was able to make a quick hack together with "su" which works: sudo nice -n -20 su -c command_to_run user_to_run_as (If you don't have to give sudo a password - perhaps because you've already just given it - you may add an "&" to put the whole thing in the background.) Since you ...


7

ionice [-p] <pids/> For example: $ ionice -p `pidof X` none: prio 0 This means X is using the none scheduling class (best effort) with priority 0 (highest priority out of 7). Read more with man ionice.


6

In general, as a non-root user, you can only decrease the priority of your tasks, not increase them. So, one approach would be to lower the priority of everything else. Or, you can set up something at the system level which handles your priorities. If you're using a relatively modern Linux distribution, the most powerful way would be with control groups. ...


6

It has to do with boot order. Highest priority is required for booting (/ and in my opinion /usr /var /tmp ...). The /boot filesystem can do with lower priority because by the time the system can start fsck's, it read the necessary files from boot already. Filesystems for home directories etc. are lower priority during boot process.


5

renice does affect the priority of a process. But as you've experienced, just because a process has higher priority doesn't imply that it will have all the resources it needs. A higher priority merely gives the process a bigger chance to grab resources. renice only affects CPU time. So it only has an effect if two or more processes are competing for CPU ...


4

"Real time" means processes that must be finished by their deadlines, or Bad Things (TM) happen. A real-time kernel is one in which the latencies by the kernel are strictly bounded (subject to possiby misbehaving hardware which just doesn't answer on time), and in which most any activity can be interrupted to let higher-priority tasks run. In the case of ...


3

awk '{print $18}' /proc/1337/stat (gets the prio for process 1337). Other options: Use ps -o pri. Specify the process id with -p 1337. Or, use -e to list all processes. Experiment with this as a starting point if you want more than just the priority: ps -e -o uid,pid,ppid,pri,ni,cmd


3

The time slice used will matter for CPU intensive jobs that require cache persistency, unless you lock a particular core to each PID. You can increase the time slice with schedular policy SCHED_BATCH and improve performance up to 300% in some cases, while reducing interactive responsiveness. The opposite effect of smaller time slices occurs with SCHED_RR ...


2

I wrote a small script in perl to do what you ask: http://pastie.org/3460943 It works by getting all the current X11 window IDs using the "xlsclients -l" command, in turn getting the window's PID with xprop. It then uses xprop -root to get the currently focused window, then loops through all the PIDs to change their nice value to 5 (keeping the currently ...


2

You can use the ondemand cpu-freq governor, as long as you set the ignore_nice_load parameter to 1. From Documentation/cpu-freq/governors.txt, ondemand section: ignore_nice_load: this parameter takes a value of '0' or '1'. When set to '0' (its default), all processes are counted towards the 'cpu utilisation' value. When set to '1', the processes ...


2

As I mentioned, @glenn-jackman gave you the answer. But just to elaborate a bit more, if you wish to give higher priority to the command but do not intend to run it as root, you could use a function (and sudo): nice_cmd() { PRIORITY=$1 ; shift CMD=$1 ; shift ${CMD} $@ & cmdpid=$! sudo renice -n ${PRIORITY} -p ${cmdpid} } Then execute it as ...


2

There are several uses for cgroups. From the system administration probably the most important one is limiting resources - the classical example here being is the cpu access. If you create a group for e.g. sshd and give it some non-negligible CPU time share (compared to other groups or the default under which fall all unsorted processes), you are guaranteed ...


2

The field exists so you can define the order in which filesystems are checked. Different partitions on the same drive should not be checked at the same time since the IO going to each filesystem will compete with one another, and slow the whole process down. Filesystems on different physical disks could be set to check in the same pass to speed up the ...


1

Process priority is not the only thing that comes into play when you are trying to tweak user experience. Compiling the kernel is a rather I/O-heavy thing - lots of reading/writing from/to small files which can stretch the file system quite a bit (there is a reason why it is sometimes used as a benchmark in its own right), especially on a multiprocessor ...


1

Relatively new feature to the kernel, but if your platform supports it you can create a cgroup for the pid after the fact give it the PID of the process and manipulate its cpu.shares value to give it as much as or as little as it needs. more info


1

Generally this is work for a traffic shaper, so that is what you should look for. As for identifying what packets belong to what application, you will probably want to look at network namespaces and/or Cgroups, but I would expect there to be some ready-to-use solutions (likely based on these).


1

In fact, RLIMIT_NICE allows you to bypass the basic rule that says that "a process can raise its nice value only if owned by root". Demonstration: # ulimit -e 30 # su nobody $ nice -n -10 top You will see that your top process runs with niceness -10. Now if you try nice -n -11 top, it will run with niceness 0, because -11 is not allowed by ...


1

If each process has its own core then there's no priority constraints. However, if you schedule a process which takes 30 minutes to run every 15 minutes, you will start to have a need to prioritize as the process will start overlapping. There's no "best" scheduling policy however. They really depend on what you want to achieve. But in the beginning, I ...


1

Adding to rozcietrzewiacz's answer: First big improvement would be the disks, use faster IOPs disks, i.e. something that runs at 10,000 or 15,000 rpm, ideally SSD and then you are only limited by your purse. Random example, Samsung's 6Gbps SATA 2 SSD: http://www.engadget.com/2011/08/17/samsungs-6gbps-ssd-gets-a-consumer-label-october-ship-date/ OCZ have ...



Only top voted, non community-wiki answers of a minimum length are eligible