Linux priority, performance monitoring directives

Source: Internet
Author: User

First, priority

Priority value = Priority Factor +nice value

The priority coefficients are determined by the system kernel and cannot be changed. The nice value can be changed manually, the lower the value of the -20~19 priority, the higher the priority, and the higher the priority value, the lower the priority level. So if you want to adjust to the highest priority, set the nice value to-20, and if you want to adjust to the lowest priority, set the nice value to 19.

Adjust the priority level:

1, the task does not run before the adjustment # nice-n-20  sh/xxx/xxx.sh          --run xxx.sh this script with the highest priority # Nice-n19  SH/ xxx/xxx.sh          --run xxx.sh with the lowest priority this script 2, the task has already started to adjust ①# top         &NBSP ;                            --  Review the current process run of the system >  r                                 nbsp      --type small r> PID to Renice:                     &NBSP ;      --Prompts for pid> Renice PID 23302 to value:               &NBSP for running processes ; --Set the nice value of this process to how much, adjust as needed ②# renice-20 PID                           Change the nice value of the process to -20# Renice  pid                     &N Bsp    Change the nice value of the process to 19  second, performance monitoring

The uptime command is used to see how long the server has been running and how many users are logged in to quickly learn about the load on the server.

The following is a running instance of uptime:

11:07:03 up 2 days, Min,  3 users,  load average:0.53, 0.31, 0.25

Current Time 11:07:03
The system has been running for up to 2 days, min
3 Users online currently
Average load: 0.53, 0.31, 0.25 last 1 minutes, 5 minutes, 15 minutes load of the system
Its value represents the number of processes waiting to be processed by the CPU, and if the CPU does not have time to process these processes, the load average value will rise;
The best value for load average is 1, which means that each process can be processed immediately and no CPU cycles is lost. For a single-CPU machine, 1 or 2 is an acceptable value, and for a multi-CPU machine, the load average value can be between 8 and 10.

You can also use the Uptime command to determine network performance. For example, a network application performance is very low, by running uptime to see if the server load is very high, if not, then the problem should be caused by the network.

You can also view the/proc/loadavg and/proc/uptime two files, note that you cannot edit the files in/proc, and you want to view them with commands such as cat, such as:
[Email protected] ~]# Cat/proc/loadavg
0.32 0.28 0.24) 1/726 29266
[Email protected] ~]# Cat/proc/uptime
174353.71 157203.24

Linux priority, performance monitoring directives

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.