Changing the default nice value for a user or group

Recently I coveredhow to increase and decrease the CPU priority of processes using nice and renice. Today I am going to cover how to change the default niceness value for a user or group. Why change the default CPU priority value? Before explaining how to change the default niceness value, let's cover why this could be useful. Scenario #1 You have a system that has thousands of users that log in via SSH and could potentially run CPU intensive tasks.

Setting process CPU priority with nice and renice

Nice is a command in Unix and Linux operating systems that allows for the adjustment of the “Niceness” value of processes. Adjusting the “niceness” value of processes allows for setting an advised CPU priority that the kernel's scheduler will use to determine which processes get more or less CPU time. In Linux this niceness value can be ignored by the scheduler, however other Unix implementations can treat this differently. Being able to adjust the niceness value comes in handy in two scenarios usually.