In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
In this issue, the editor will bring you about how to use the Linux performance testing tool dstat. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.
When doing performance testing, we inevitably need linux monitoring tools and commands, and there are many mature performance monitoring tools in the industry, which are also searched on the Internet, which also cause some interference to the selection of different projects. In the end, which is easier to use and which monitoring is more comprehensive, no one has a very good explanation. Finally, after a series of search, I finally found a gadget dstat that can be comprehensively monitored. The following content is collected by looking up information on the Internet.
Brief introduction
Dstat is a versatile product that replaces commands such as vmstat,iostat,netstat and ifstat. Dstat overcomes the limitations of these commands and adds some additional features, monitoring items, and flexibility. Dstat makes it easy to monitor system health and use it for benchmarking and troubleshooting.
Dstat allows you to see all system resources in real time, for example, you can compare disk utilization by counting the current state of the IDE controller, or directly through network bandwidth values to compare disk throughput (at the same time interval).
Dstat will provide you with option information in the form of a list and clearly tell you in what magnitude and unit the output is displayed. In this way, information confusion and misinformation can be better avoided. More importantly, it makes it easier for you to write plug-ins to collect the data you want and extend it in a way that has never been done before.
The default output of dstat is designed for people to view in real time, but you can also export details to a file via CSV and import them into Gnumeric or Excel generated tables.
Characteristics
⒈ combines vmstat,iostat,ifstat,netstat and more information
Real-time display of statistics by ⒉
⒊ can analyze and troubleshoot by enabling monitoring items and sorting
⒋ modular design
5. Written in python to make it easier to extend existing tasks
6. It is easy to expand and add your counters (please contribute to this)
7. Many of the included extensions fully illustrate the convenience of adding new monitoring projects
8. Block devices / network devices can be grouped and the total number is given.
9. You can display the current status of each device
10. Extremely accurate time accuracy, even if the system load is high, it will not delay the display.
11. Display accurate units and limit the range of conversion errors
twelve。 Display different units in different colors
13. Display the intermediate result with a delay of less than 1 second
14. Support for exporting reports in CSV format, and can be imported into Gnumeric and Excel to generate graphics
Installation method
Ubuntu/Mint and Debin systems:
There are related installation packages in the local software library. You can install them with the following command:
# sudo apt-get install dstat
RHEL/Centos and Fedora systems:
You can add relevant installation packages to the romforge software library. Refer to the instructions and use the following command to install them easily:
# yum install dstat
ArchLinux system:
The related software package is in the community repository, and you can install it with this command:
# pacman-S dstat
Usage
The basic use of dstat is to enter the dstat command, and the output is as follows:
This is the information displayed by the default output:
CPU status: usage of CPU. The more interesting part of the report is that it shows the users, systems, and free parts, which gives a better analysis of the current usage of CPU. If you see that the status of CPU in the "wait" column is a high usage value, there are some other problems with the system. When the state of CPU is in "waits", it is because it is waiting for a response from an Imax O device (such as memory, disk, or network) and has not yet received it.
Disk statistics (dsk): the read and write operations of the disk. This column shows the total number of reads and writes to the disk.
Network Statistics (net): data sent and received by network devices. This column shows the total number of data received and sent by the network.
Paging statistics (paging): the paging activity of the system. Paging refers to a memory management technique used to find system scenarios. A large page indicates that the system is using a lot of swap space, or memory is very scattered, and in most cases you want to see that the values of page in and page out are 0.
System statistics (system): this item shows int and context switching (csw). This statistic makes sense only when there is a comparative baseline. The higher statistics in this column usually indicate that a large number of processes are causing congestion and require attention to CPU. Your server will normally run some programs, so this item always displays some values.
By default, dstat refreshes data every second. If you want to quit dstat, you can press the "CTRL+C" key.
It is important to note that the first line of the report, usually all the statistics here do not show numerical values.
This is because dstat gives a summary from the previous report, so the first run does not have data about averages and total values.
However, dstat can control the report interval and the number of reports by passing two parameters to run. For example, if you want dstat to output default monitoring, report output interval of 3 seconds, and output 10 results in the report, you can run the following command:
# dstat 3 10
There are many parameters to choose from in the dstat command, which you can see through the man dstat command. Most commonly used parameters are these:
-l: display load statistics
-m: displays memory usage (including used,buffer,cache, free values)
-r: displays Istroke O statistics
-s: displays the usage of the swap partition
-t: displays the current time on the first line
-fs: displays file system statistics (including total number of files and inodes values)
-nocolor: do not display colors (sometimes useful)
-socket: displays network statistics
-tcp: displays commonly used TCP statistics
-udp: some dynamic data showing the listening UDP interface and its current usage
Of course, more than these uses, dstat comes with a number of plug-ins that greatly expand its functionality. You can check out some of their uses by looking at the / usr/share/dstat directory, some of which are commonly used:
-- disk-util: displays the busy status of the disk at a certain time
-- freespace: displays the current disk space utilization
-- proc-count: displays the number of programs running
-- top-bio: indicates the largest process of block iBand O
-- top-cpu: graphically shows the processes that CPU takes up the most
-- top-io: displays the maximum process of normal Iamp O
-- top-mem: displays the processes that consume the most memory
To give some examples:
See who is using all the memory:
# dstat-g-l-m-s-top-mem
Displays some data about CPU resource depletion:
# dstat-c-y-l-proc-count-- top-cpu
How to output a csv file
To export a file in csv format for later use, you can use the following command:
# dstat-output / tmp/sampleoutput.csv-cdn
This is how the Linux performance testing tool dstat shared by Xiaobian is used. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.