Use Linux Command Line performance testing tools

Source: Internet
Author: User
Article Title: Use the command line performance testing tool in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

The above references the Linux performance considerations described in the IBM Redbook. The detection section in the cut-off and modify documents will be introduced today, but this section is not very detailed. I will add some references later.

※Note: The command output information shown in the following figure is based on the platform of the Hongqi DC Server 5.0 for x86 Sp1, which may vary greatly in different operating systems or core versions, pay attention to the comparison.

I. uptime

The Uptime command displays how long the server has been running, how many login users there are, and the overall server performance evaluation (load average ). The load average value records the load of the last 1 minute, 5 minutes, and 15 minutes respectively. The load average is not a percentage, but the number of processes waiting for execution in the queue. If the process requires that the CPU time be blocked (meaning that the CPU does not have time to process it), the load average value will increase. On the other hand, if each process can immediately obtain the CPU access time, this value will be reduced.

The optimal value of load average under UP kernel is 1, which means that each process can be processed by the CPU immediately. Of course, there is no problem in lower level, which only indicates that part of the resources are wasted. However, this value varies between different systems. For example, for a single-CPU workstation, loading average of 1 or 2 is acceptable, in a multi-CPU system, this value should be divided by the number of physical CPUs. If the number of CPUs is 4 and the load average is 8 or 10, the result is more than 2 points.

You can use uptime to determine whether a performance problem occurs on the server or on the network. For example, if the Running Performance of a network application is not satisfactory, run uptime to check whether the system load is high. If not, this problem may occur on your network.

Ii. top

The Top command displays the actual CPU usage. By default, it displays information about the CPU usage tasks on the server and refreshes every 5 seconds. You can classify them in multiple ways, including PID, time, and memory usage.

The following describes the output values:

Reference
PID: process ID
USER; USER Name of the process owner
PRI: Process Priority
NI: nice
SIZE: The amount of memory occupied by the process (code + Data + stack)
RSS; number of physical memory used by the Process
SHARE; the amount of memory shared by the process and other processes
STAT: Process status: S = sleep, R = running, T = stopped, D = stopped, Z = botnet
% CPU: Shared CPU usage
% MEM; shared physical memory
TIME: the CPU usage TIME of the process.
COMMAND: COMMAND Line for starting a task (including parameters)


Process Priority and nice level
The process priority is a parameter that determines the priority of processes executed by the CPU. The kernel will adjust this value as needed. Nice value is a restriction on priority. The process priority value cannot be lower than the nice value. (The lower the nice value, the higher the priority)
The process priority cannot be changed manually. Only by changing the nice value can the process priority be adjusted indirectly. If a process runs too slowly, you can assign more CPU resources to it by specifying a lower nice value. Of course, this means that some other processes will be allocated less CPU resources and run slower. Linux supports the range of nice values from 19 (low priority) to-20 (high priority). The default value is 0. If you want to change the nice value of a process to a negative value (high priority), you must use the su command to log on to the root user. Below are some command examples for adjusting nice values,
Start the program xyz with nice value-5

# Nice? N-5 xyz

Change the nice value of a running program

# Renice level pid

Change the nice value of the process with pid 2500 to 10.

# Renice 10 2500

Botnets
When a process ends, it usually takes some time to complete all the tasks (such as closing open files) before it ends. In a very short period of time, the status of this process is zombie. After the process completes all the close tasks, it will submit the information to the parent process. In some cases, a zombie process cannot close itself, and the process is in the z (zombie) state ). You cannot use the kill command to kill a zombie process because it is marked as "dead ". If you cannot get rid of a zombie process, you can kill its parent process and the zombie process disappears. However, if the parent process is an init process, you cannot kill the init process because init is an important system process. In this case, you can only restart the server once to get rid of the zombie process. Why does the application become frozen?

[1] [2] [3] [4] Next page

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.