I want to run mplayer with higher priority than any other processes, including the IO-processes. How can I do that?

  • There is no cross-unix variant answer to this question. In general it's better to describe what OS you're using (including the distribution for Linux, but here it won't matter much if at all). I've added a linux tag, please change it if that's not what you're using. Feb 17, 2011 at 18:05
  • Do you mind if I ask why you're looking to increase the priority of mplayer? I ask because I've had issues before where increasing the priority of mplayer, the effect was opposite what I was trying to accomplish because mplayer would get busy using up CPU time doing post-production cleaning, then grind to a halt as the network finally got a gasp of air to go grab more content, then mplayer would stutter back to life, just to grind to a halt again waiting for network.
    – killermist
    Jun 10, 2012 at 14:53
  • I asked this cause, I am playing a movie through mplayer. Whenever I try to download few GB files over network. Mplayer observes slicing and a jerk while playing.
    – SHW
    Jun 11, 2012 at 7:16

2 Answers 2


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 /etc/security/limits.conf.

  • 1
    Mentioning the io scheduler classes is good, because that's likely to be a big factor. Worth nothing that for the middle -c2 scheduling class, processes are by default sorted by the nice level, so the example command you've given is really not necessary. One could try putting mplayer in the -c1 realtime class. (With root access.)
    – mattdm
    Feb 17, 2011 at 16:24

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. This is in its infancy so basically you'd have to configure everything by hand, but in short what you want is to configure the categorizer to put different processes into different CPU control groups, and then to give the mplayer process more CPU shares.

You must log in to answer this question.

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