Nmon performance monitoring (1)

1.  N Mon Performance Monitoring

Linux and Unix biggest difference: the former is a free open source software; the latter is the implementation of intellectual property protection for traditional commercial software source code.

The other two differences:

  • UNIX Most systems with hardware support, and Linux on can run on multiple hardware platforms .
  • UNIX is a commercial software, Linux is free software, free, open-source . UNIX (5 million dollars ) and Linux for free

 

How to monitor Linux performance :

  • Vmstat ------ view system status, hardware and system information
  • Top ------ view the process as well as some active system status
  • iostat ------ View CPU load, disk status

vmstat is a view of the overall system performance of gadget, a compact, even in a very heavy in the case where operation was good, and may collect performance data obtained by the continuous time interval.

 

Parameter Description:

  • R & lt , the number of threads may run queue, these threads are runnable state, but not yet executed;
  • b , are blocked ( blocked number of processes), and is waiting for IO requests;
  • in , the number of interrupts to be processed
  • CS , the system is doing the number of context switches
  • US , occupied by the user CPU percentage
  • SYS , kernel and interrupts occupy CPU percentage
  • WA , all runnable threads are blocked in the future are waiting for IO , this time the CPU idle percentage
  • the above mentioned id , the CPU is completely idle percentage
  • swpd , has been used SWAP space, KB as a unit;
  • Free , available physical memory size, KB units;
  • BUFF , physical memory read and write operations to the cache buffer size, KB units;
  • cache , the physical memory is used to cache the process address space cache size, KB as a unit;
  • Si , from data SWAP read into the RAM ( the swap in size), KB units;
  • SO , the data from the RAM is written to the SWAP ( the swap OUT size), KB units;
  • BI , disk blocks from the file system or SWAP read into the RAM ( Blocks in size), Block units;
  • BO , disk blocks from RAM write file system or the SWAP ( Blocks OUT size), Block units;

 

To distinguish between different types of application systems is very important, usually used can be divided into two types:

IO related, IO related application typically used to process large amounts of data, and requires a large amount of memory storage, frequently IO to read and write data, while the CPU requirements are less, most of the CPU is waiting for the hard disk, for example, a database server, file servers.

CPU related, CPU related applications that require a large number of CPU , such as high concurrent web / mail server, the image / video processing, scientific computing, and so may be regarded as CPU -related applications.

Examples of the first . 1 one is manifested when a large file server file copy feature, the 2 one is CPU manifested when making a large number calculating the feature:  

 

 

The most obvious difference between the two examples above is the id column, on behalf of CPU idle rate, when copying files id remained at 50 or so%, CPU time compute-intensive id is substantially 0 .

 

Performance testing the CPU :

CPU occupancy depends on the CPU types of transactions executed on, such as copies of documents generally uses less CPU , because most of the work is done by DMA ( Direct Memory Access complete), just after the completion of copy to an interrupt to let CPU know copy has been completed ; but the scientific computing usually take up more CPU , most of the work needed to calculate the CPU subsystem completed only on a temporary, memory, hard drives and other data storage work.

Ready knowledge ----- operating system basics, such as: interrupts, process scheduling, process context switch, you can run queues.

Test CPU of reference:

Usually the system can reach the following objectives:

CPU usage: If CPU have 100 % utilization, it should reach such a balance: 65 % - 70 % the User Time , 30 % - 35 % the System Time , 0 % - . 5 % the Idle Time ;

Context switching: context switches should CPU utilization taken together, if they can maintain above CPU utilization balance, a large number of context switches is acceptable;

Run queue may be: each of which may be not have more than the run queue . 1 - . 3 threads (per processor), such as: a dual processor system run queue's should not exceed . 6 threads.

Case Analysis:

 

As can be seen from the above data points:

  • Interrupts ( in ) is very high, context Switch ( cs ) is relatively low, indicating that CPU has been kept requesting resources;
  • Time System ( SY ) has been maintained at 80 % or more, and the lower context switching ( CS ), a process described may have been occupied by the CPU ;
  • Queue RUN ( R & lt ) immediately . 4 th.

 

Performance testing Memory :

Here the "memory" includes physical memory and virtual memory.

Virtual memory ( the Virtual Memory ) of the computer memory to the hard disk expansion, physical memory ( the RAM ) and hard disk space portion ( the SWAP ) grouped together as a coherent provide virtual memory virtual memory space of the computer;

Pros: Memory "changed much", you can run more and larger programs;

Disadvantages: The use of the hard disk when the memory is subjected to impact the overall performance, hard disk read and write speeds orders of magnitude slower than memory, and RAM and SWAP exchange between the increased load on the system.

SWAP

It is LINUX virtual memory partition under , its role is after the physical memory runs out , the disk space ( that is, SWAP partition ) into the virtual memory to use .

Note that , although the SWAP partition can be used as "virtual" memory , but its speed is much slower than physical memory

Usually the size of physical memory to 2 times

case study:

One day , a customer calls to need technical assistance , and complained that the usual 15 seconds to open the page now need 20 minutes to be open ( RedHat ) .

Performance analysis step

First, using vmstat view system performance substantially where, as shown below:

 

Analysis :

  • It is not due to insufficient memory , because swap never did change (si and so). Although much free memory (free), but swpd has not changed .
  • CPU also not much problem , although there are some run queue (procs r), but there is always the processor also 50% more than the idle (CPU id).
  • There are too many context switches (CS) and disk block from the RAM are read in (bi).
  • CPU there are an average of 20% of I / O waiting situation .

Conclusion :  From the above sum up , this is an I / O bottleneck .

Guess you like

Origin www.cnblogs.com/xysjy8/p/11114027.html