View CPU, memory, network traffic, and disk I/O in CentOS

Source: Internet
Author: User

CentOS view CPU, memory, network traffic, and disk I/O installation yum install-y sysstat sar-d 1 1 rrqm/s: the number of merge read operations per second. That is, delta (rmerge)/swrqm/s: Number of merge write operations per second. Delta (wmerge)/sr/s: the number of read I/O devices per second. That is, delta (rio)/sw/s: the number of write I/O devices completed per second. That is, delta (wio)/srsec/s: Number of read sectors per second. That is, delta (rsect)/swsec/s: Number of write sectors per second. That is, delta (wsect)/srkB/s: the number of read K bytes per second. It is half of rsect/s because the size of each slice is 512 bytes. (To be calculated) wkB/s: Number of write K bytes per second. Half of wsect/s. Avgrq-sz: average data size (slice) of each device I/O operation ). Delta (rsect + wsect)/delta (rio + wio) avgqu-sz: Average I/O queue length. That is, delta (aveq)/s/1000 (because aveq is measured in milliseconds ). Await: average wait time (in milliseconds) for each device I/O operation ). That is, delta (ruse + wuse)/delta (rio + wio) svctm: Average service time per device I/O operation (MS ). That is, delta (use)/delta (rio + wio) % util: the percentage of time in one second for I/O operations, or the number of I/O queues in one second is not empty. That is, delta (use)/s/1000 (because the Unit of use is millisecond) If % util is close to 100%, it indicates that too many I/O requests are generated and the I/O system is fully loaded, this disk may have a bottleneck. When the idle is less than 70% I/O, the load is high. Generally, the read speed is wait. you can also view the parameters B (number of processes waiting for resources) and wa in combination with vmstat (percentage of CPU time occupied by I/O wait, higher than 30% when I/O pressure is high) in addition, we can also refer to svctm which is generally smaller than await (because the wait time of the simultaneously waiting request is calculated repeatedly). The size of svctm is generally related to disk performance, the CPU/memory load will also affect it, and too many requests will indirectly lead to the increase of svctm. The size of await generally depends on the service time (svctm), the length of the I/O queue, and the mode in which I/O requests are sent. If svctm is close to await, it means that I/O has almost no waiting time. If await is much larger than svctm, it means that the I/O queue is too long and the response time of the application is slow, if the response time exceeds the allowable range, you can consider replacing a faster disk, adjusting the kernel elevator algorithm, optimizing the application, or upgrading the CPU. The queue length (avgqu-sz) can also be used as an indicator to measure the system I/O load. However, because avgqu-sz is based on the average per unit time, therefore, it cannot reflect the instantaneous I/O flood. In the command line mode, how do I view CPU, memory usage, network traffic, and disk I/O? Q: How can I view CPU, memory usage, network traffic, and disk I/O in the command line mode? A: In command line mode, 1. command for viewing CPU usage $ vmstat 5 refresh every 5 seconds, data with CPU usage on the rightmost side $ top and then sort by Shift + P according to process processor usage 2. command for checking memory usage $ free top and sort by Shift + M by process memory usage $ top 3. to view network traffic, you can use the iptraf tool $ iptraf-g "to obtain the network traffic of an Interface by comparing the RX and TX data of two time network interfaces; ifconfig eth1 $ date; ifconfig eth1 4. view disk I/o $ iostat-d-x/dev/sdc3 2 Use iostat to view disk I/o of Disk/dev/sdc3, refresh every two seconds $ vmstat 2 Use vmstat to view information about the io part procs: r->; Number of processes B->; number of processes waiting for io w->; you can enter the running queue but the replaced process memoyswap->; currently available swap memory (k indicates) free->; idle memory (k indicates) pagesre -- recycled page mf -- non-serious error page pi -- enter the page number (k indicates) po -- number of outgoing pages (k) fr -- number of idle pages (k) de -- "sr of the number of missed items on the page read in advance --" Displays disk operations per second on the page scanned by the clock algorithm. S indicates a scsi disk, 0 indicates that the disk number fault shows the number of interrupts per second in -- device interrupt sy -- system interrupt cy -- cpu switch cpu usage state cs -- user process time sy -- the time id used by the system process -- the idle time of the cpu, where: if r is often greater than 4 and the id is often less than 40, the cpu load is heavy. If pi and po are not equal to 0 for a long time, the memory is insufficient. If the disk is often not equal to 0 and the queue in B is greater than 3, the io performance is poor.
 

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.