Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to check disk io cost in Linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How to check the disk io cost in Linux? I believe many inexperienced people don't know what to do about it. Therefore, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

The first is to observe the cpu information in the top command

The cpu messages that Top can see are:

The code is as follows:

Tasks: 29 total, 1 running, 28 sleeping, 0 stopped, 0 zombie

Cpu (s): 0.3% us, 1.0% sy, 0% ni, 98.7% id, 0% wa, 0% hi, 0% si

The specific explanations are as follows:

Tasks: 29 Total number of total processes

1 running the number of processes running

28 the number of sleeping sleep processes

Number of processes stopped by 0 stopped

0 zombie number of zombie processes

Cpu (s):

0.3% percentage of us user space occupied by CPU

1.0% sy kernel space occupies CPU percentage

Percentage of CPU occupied by processes that have changed priorities in the process space of 0.0% ni users

98.7% id idle CPU

Percentage of CPU time that 0.0% wa waits for input and output

0.0% hi

0.0% si

The percentage of 0. 0% wa can roughly reflect whether the current disk io requests are frequent. If the number of wa is large, it means that there are more io waiting for input and output.

The second kind: use vmstat

The vmstat command reports statistics about threads, virtual memory, disks, traps, and CPU activity. Reports generated by the vmstat command can be used to balance system load activity. These system-wide statistics (in all processors) calculate the average as a percentage or the sum.

Enter the command:

The code is as follows:

Vmstat 2 5

If it is found that the number of waiting processes and processes in uninterrupted sleep is very large, and the number of blocks sent to and received from block devices is very large, it means that there is a large number of disk io.

Vmstat parameter explanation:

Procs

R: number of processes waiting to run b: number of processes in uninterrupted sleep w: number of runnable processes swapped out. This number is calculated by linux, but linux does not run out of swap space

Memory

Swpd: virtual memory usage (in KB)

Free: free memory (per KB)

Buff: the amount of memory used as the cache (in KB)

Swap

Si: the number of swap pages swapped from disk to memory (in KB/ seconds)

So: the number of pages swapped from memory to disk (in KB/ seconds)

IO

Bi: the number of blocks sent to the block device, in blocks per second

Bo: the number of blocks received from the block device, in blocks per second

System

In: interrupts per second, including clock interrupts

Cs: number of environment (context) switches per second

CPU

Displayed as a percentage of total CPU usage

Us: CPU usage time

Sy: CPU system usage time

Id: idle time

Quasi-measurement

More vmstat usage information

The third kind: use iostat

Installation:

Iostat is a tool in the sysstat toolset and needs to be installed.

Centos is installed as follows:

The code is as follows:

Yum install sysstat

Ubuntu is installed as follows:

The code is as follows:

Aptitude install sysstat

Use:

Iostat-dx displays disk extension information

Root@fileapp:~# iostat-dx

Ralanche s and wbank s are read and write operations per second, respectively, while the rKB/s and wKB/s columns show the amount of data read and written in kilobytes per second

After reading the above, have you mastered how to check the disk io cost in Linux? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report