assistanz
Assistanz

nice and renice command usages

cPanel Server Management

For 24×7 cPanel Server Management with Monitoring, Unlimited Tech Support, Disaster Recovery, Security updates and much more Signup today!

Nice Command

Linux nice command is Run Process With Modified Scheduling Priority ( nicenesses ). With the help of Nice command in Linux you can set process priority. If you give a process a higher priority, then Kernel will allocate more cpu time to that process.

By default when a programe is launched in Linux, it gets launched with the priority of ‘0’. However you can change the priority of your programes by either of the following methods.

You can launch a programe with your required priority. Or you can also change the priority of an already running process.

Process priority values range from -20 to 19. A process with the nice value of -20 is considered to be on top of the priority. And a process with nice value of 19 is considered to be low on the priority list.

You can use ps -al, top and various command to check priority. The column that starts with “NI” shows the nice value(priority of the process). You can clearly see that most of them has got a ‘0’ priority.

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
31102 nobody    16   0  269m  22m  10m R  2.0  0.6   0:04.44 /usr/local/apache/bin/httpd -k start -DSSL
27956 root      15   0 12884 1268  832 R  1.0  0.0   2:53.60 top -c
22384 mysql      5 -10 2830m 204m 3864 S  0.7  5.2 372:40.00 /usr/sbin/mysqld –basedir=/ –datadir=/var/lib/mysql –user=mysql –log-error=/var/lib/mysql/serv.med1med
1 root      15   0 10368  584  552 S  0.0  0.0   0:03.09 init [3]
2 root      RT  -5     0    0    0 S  0.0  0.0   0:06.15 [migration/0]
3 root      34  19     0    0    0 S  0.0  0.0   0:00.28 [ksoftirqd/0]
4 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 [watchdog/0]

For example

nice -10 Will set a process with the priority of “10”.

Renice Command

In order to change the priority of an already running process you can use “renice” command.

Suppose you see that your machine is running slow due to some lengthy process(which is not a required process at the moment), then you can reduce the priority of that process with the help of renice command. And also increase the priority of your required process at the moment.

renice command is very much similar to the nice command( interms of options in priority), however it does differ slightly in terms of parameters. You can give username,groupname etc in renice command as a parameter.

Examples:

renice 15 -p 20380 (this will set the priority of process id no 20380 to 15)

renice -17 -p 24132 -u mysql (this will set the priority of the process id 24132 to -17)

renice 11 -u cpanel,nobody -g testuser (this will set all process owned by “cpanel”,”nobody” and also the group “testuser” to 11)

cPanel Server Management 

AssistanZ is a pioneer in offering 24×7 cPanel Server Management Service since 2004. We offer 24×7 cPanel Server Management

cPanel Server Management

cPanel Installation and Setup

cPanel Server Optimization

cPanel Server Migration

cPanel Server Security and Hardering

cPanel Server Monitoring

cPanel Server Hack Recovery

and Much more    

DirectAdmin Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk
$ 99 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • NDA & SLA
  • SLA Review Meetings
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation
  •  

Platinum Support

24/7 Proactive Support
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Support

$ 30 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response Time
  • 4 Hours Resolution time for the Possible Issues
  • Security and Performance Optimization
  • React to Customers queries
  • Simple SignUp Process
  • Instant Account Activation
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support