dockernicerenice

‘Nice-ness’ of a process inside a container


So in my current app setting a certain process running inside a container runs another process. I need to set the nice value of the new process to be higher.

When ran on the OS I could just do nice -n19 second_task. How does this work in the context of the docker container?


Solution

  • When ran on the OS I could just do nice -n19 second_task. How does this work in the context of the docker container?

    It works exactly the same way. When you're inside docker OS, you can just nice -n19 second_task.

    Exactly the same restrictions apply as outside docker OS, so nice executable has to exists inside docker OS to be run, the same way the nice executable has to exist for you to run nice on your host OS. And user has to have appropriate limits (see man limits.conf) or be root.