dstat

dstat 用来替换vmstat、iostat、netstat、nfsstat和ifstat这些命令的工具,可以说是一个全能的系统信息统计工具。

相关命令

Linux存储性能观测——iostat命令详解
Linux存储性能观测——vmstat命令详解
Linux存储性能观测——free命令详解

安装

安装方式:

yum install -y dstat #Centos
sudo apt-get install dstat #Ubuntu

安装出现的问题以及解决方案:

# Ubuntu下的操作
$ sudo apt-get install dstat
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package dstat
# Ubuntu下找不到包的时候,只需要执行如下命令即可
$ sudo apt-get update

常用命令形式

$ dstat # 默认参数是-cdngy
You did not select any stats, using -cdngy by default.
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw 3   0  96   0   0   0| 436k  879k|   0     0 |   0    72B|4284  3494 7   0  92   0   0   0|   0   136k|  52k  327k|   0     0 |7019  4807 7   0  91   2   0   0|   0    26M|  32k   83k|   0     0 |6583  5640 7   0  93   0   0   0|   0  4086k|  37k  105k|   0     0 |5172  3559 7   0  92   0   0   0|   0   363k|  49k  227k|   0     0 |6626  4492

total-cpu-usage:

usr sys idl wai hiq siq
用户时间占比 系统时间占比 空闲时间占比 等待时间占比 硬中断 软中断

dsk/total:

read writ
磁盘的读总数(KB或者MB) 磁盘的写总数(KB或者MB)

net/total:

recv send
网络设备接收的数据总数(KB或者MB) 网络设备发送的数据总数(KB或者MB)

paging(系统的分页活动):

in out
换入次数 换出次数

system(系统统计):

int csw
终端次数 上下文切换次数

英文说明

DSTAT(1)                                                                                                                                                                                                                      NAMEdstat - versatile tool for generating system resource statisticsSYNOPSISdstat [-afv] [options..] [delay [count]]DESCRIPTIONDstat is a versatile replacement for vmstat, iostat and ifstat. Dstat overcomes some of the limitations and adds some extra features.Dstat allows you to view all of your system resources instantly, you can eg. compare disk usage in combination with interrupts from your IDE controller, or compare the network bandwidth numbers directly with the diskthroughput (in the same interval).Dstat also cleverly gives you the most detailed information in columns and clearly indicates in what magnitude and unit the output is displayed. Less confusion, less mistakes, more efficient.Dstat is unique in letting you aggregate block device throughput for a certain diskset or network bandwidth for a group of interfaces, ie. you can see the throughput for all the block devices that make up a singlefilesystem or storage system.Dstat allows its data to be directly written to a CSV file to be imported and used by OpenOffice, Gnumeric or Excel to create graphs.NoteUsers of Sleuthkit might find Sleuthkit’s dstat being renamed to datastat to avoid a name conflict. See Debian bug #283709 for more information.OPTIONS-c, --cpuenable cpu stats (system, user, idle, wait, hardware interrupt, software interrupt)-C 0,3,totalinclude cpu0, cpu3 and total (when using -c/--cpu)-d, --diskenable disk stats (read, write)-D total,hdainclude total and hda (when using -d/--disk)-g, --pageenable page stats (page in, page out)-i, --intenable interrupt stats-I 5,10include interrupt 5 and 10 (when using -i/--int)-l, --loadenable load average stats (1 min, 5 mins, 15mins)-m, --memenable memory stats (used, buffers, cache, free)-n, --netenable network stats (receive, send)-N eth1,totalinclude eth1 and total (when using -n/--net)-p, --procenable process stats (runnable, uninterruptible, new)-r, --ioenable I/O request stats (read, write requests)-s, --swapenable swap stats (used, free)-S swap1,totalinclude swap1 and total (when using -s/--swap)-t, --timeenable time/date output-T, --epochenable time counter (seconds since epoch)-y, --sysenable system stats (interrupts, context switches)--aio  enable aio stats (asynchronous I/O)--fs, --filesystemenable filesystem stats (open files, inodes)--ipc  enable ipc stats (message queue, semaphores, shared memory)--lock enable file lock stats (posix, flock, read, write)--raw  enable raw stats (raw sockets)--socketenable socket stats (total, tcp, udp, raw, ip-fragments)--tcp  enable tcp stats (listen, established, syn, time_wait, close)--udp  enable udp stats (listen, active)--unix enable unix stats (datagram, stream, listen, active)--vm   enable vm stats (hard pagefaults, soft pagefaults, allocated, free)--plugin-nameenable (external) plugins by plugin name, see PLUGINS for optionsPossible internal stats areaio, cpu, cpu24, disk, disk24, disk24old, epoch, fs, int, int24, io, ipc, load, lock, mem, net, page, page24, proc, raw, socket, swap, swapold, sys, tcp, time, udp, unix, vm--list list the internal and external plugin names-a, --allequals -cdngy (default)-f, --fullexpand -C, -D, -I, -N and -S discovery lists-v, --vmstatequals -pmgdsc -D total--bits force bits for values expressed in bytes--floatforce float values on screen (mutual exclusive with --integer)--integerforce integer values on screen (mutual exclusive with --float)--bw, --blackonwhitechange colors for white background terminal--nocolordisable colors (implies --noupdate)--noheadersdisable repetitive headers--noupdatedisable intermediate updates when delay > 1--output filewrite CSV output to file--profileshow profiling statistics when exiting dstatPLUGINSWhile anyone can create their own dstat plugins (and contribute them) dstat ships with a number of plugins already that extend its capabilities greatly. Here is an overview of the plugins dstat ships with:--batterybattery in percentage (needs ACPI)--battery-remainbattery remaining in hours, minutes (needs ACPI)--cpufreqCPU frequency in percentage (needs ACPI)--dbus number of dbus connections (needs python-dbus)--disk-tpsper disk transactions per second (tps) stats--disk-utilper disk utilization in percentage--dstatshow dstat cputime consumption and latency--dstat-cpushow dstat advanced cpu usage--dstat-ctxtshow dstat context switches--dstat-memshow dstat advanced memory usage--fan  fan speed (needs ACPI)--freespaceper filesystem disk usage--gpfs GPFS read/write I/O (needs mmpmon)--gpfs-opsGPFS filesystem operations (needs mmpmon)--helloworldHello world example dstat plugin--innodb-buffershow innodb buffer stats--innodb-ioshow innodb I/O stats--innodb-opsshow innodb operations counters--lustreshow lustre I/O throughput--memcache-hitsshow the number of hits and misses from memcache--mysql5-cmdsshow the MySQL5 command stats--mysql5-connshow the MySQL5 connection stats--mysql5-ioshow the MySQL5 I/O stats--mysql5-keysshow the MySQL5 keys stats--mysql-ioshow the MySQL I/O stats--mysql-keysshow the MySQL keys stats--net-packetsshow the number of packets received and transmitted--nfs3 show NFS v3 client operations--nfs3-opsshow extended NFS v3 client operations--nfsd3show NFS v3 server operations--nfsd3-opsshow extended NFS v3 server operations--ntp  show NTP time from an NTP server--postfixshow postfix queue sizes (needs postfix)--powershow power usage--proc-countshow total number of processes--qmailshow qmail queue sizes (needs qmail)--rpc  show RPC client calls stats--rpcd show RPC server calls stats--sendmailshow sendmail queue size (needs sendmail)--snoozeshow number of ticks per second--squidshow squid usage statistics--test show test plugin output--thermalsystem temperature sensors--top-bioshow most expensive block I/O process--top-bio-advshow most expensive block I/O process (incl. pid and other stats)--top-childwaitshow process waiting for child the most--top-cpushow most expensive CPU process--top-cpu-advshow most expensive CPU process (incl. pid and other stats)--top-cputimeshow process using the most CPU time (in ms)--top-cputime-avgshow process with the highest average timeslice (in ms)--top-intshow most frequent interrupt--top-ioshow most expensive I/O process--top-io-advshow most expensive I/O process (incl. pid and other stats)--top-latencyshow process with highest total latency (in ms)--top-latency-avgshow process with the highest average latency (in ms)--top-memshow process using the most memory--top-oomshow process that will be killed by OOM the first--utmp show number of utmp connections (needs python-utmp)--vmk-hbashow VMware ESX kernel vmhba stats--vmk-intshow VMware ESX kernel interrupt stats--vmk-nicshow VMware ESX kernel port stats--vm-memctlshow ballooning status inside VMware guests--vz-cpushow CPU usage per OpenVZ guest--vz-ioshow I/O usage per OpenVZ guest--vz-ubcshow OpenVZ user beancounters--wifi wireless link quality and signal to noise ratioARGUMENTSdelay is the delay in seconds between each updatecount is the number of updates to display before exitingThe default delay is 1 and count is unspecified (unlimited)INTERMEDIATE UPDATESWhen invoking dstat with a delay greater than 1 and without the --noupdate option, it will show intermediate updates, ie. the first time a 1 sec average, the second update a 2 second average, etc. until the delay has beenreached.So in case you specified a delay of 10, the 9 intermediate updates are NOT snapshots, they are averages over the time that passed since the last final update. The end result is that you get a 10 second average on a newline, just like with vmstat.EXAMPLESUsing dstat to relate disk-throughput with network-usage (eth0), total CPU-usage and system counters:dstat -dnyc -N eth0 -C total -f 5Checking dstat’s behaviour and the system impact of dstat:dstat -taf --debugUsing the time plugin together with cpu, net, disk, system, load, proc and top_cpu plugins:dstat -tcndylp --top-cputhis is identical todstat --time --cpu --net --disk --sys --load --proc --top-cpuUsing dstat to relate cpu stats with interrupts per device:dstat -tcyifBUGSSince it is practically impossible to test dstat on every possible permutation of kernel, python or distribution version, I need your help and your feedback to fix the remaining problems. If you have improvements orbugreports, please send them to: [1]dag@wieers.comNotePlease see the TODO file for known bugs and future plans.FILESPaths that may contain external dstat_*.py plugins:~/.dstat/(path of binary)/plugins//usr/share/dstat//usr/local/share/dstat/SEE ALSOPerformance toolsifstat(1), iftop(8), iostat(1), mpstat(1), netstat(1), nfsstat(1), nstat, vmstat(1), xosview(1)Debugging toolshtop(1), lslk(1), lsof(8), top(1)Process tracingltrace(1), pmap(1), ps(1), pstack(1), strace(1)Binary debuggingldd(1), file(1), nm(1), objdump(1), readelf(1)Memory usage toolsfree(1), memusage, memusagestat, slabtop(1)Accounting toolsdump-acct, dump-utmp, sa(8)Hardware debugging toolsdmidecode, ifinfo(1), lsdev(1), lshal(1), lshw(1), lsmod(8), lspci(8), lsusb(8), smartctl(8), x86info(1)Application debuggingmailstats(8), qshape(1)Xorg related toolsxdpyinfo(1), xrestop(1)Other useful infocollectl(1), proc(5), procinfo(8)AUTHORWritten by Dag Wieers [1]dag@wieers.comHomepage at [2]http://dag.wieers.com/home-made/dstat/This manpage was initially written by Andrew Pollock [3]apollock@debian.org for the Debian GNU/Linux system.REFERENCES1. dag@wieers.commailto:dag@wieers.com2. http://dag.wieers.com/home-made/dstat/http://dag.wieers.com/home-made/dstat/3. apollock@debian.orgmailto:apollock@debian.org0.7.0                                                                                                       06/15/2010                                                                                                      DSTAT(1)

参考资料

linux manpage dstat

Linux性能观测——dstat命令详解相关推荐

  1. Linux存储性能观测——vmstat命令详解

    功能:获得有关进程.虚存.页面交换空间及 CPU活动的信息 特点: 可以看到整个系统的负载情况,而不是单独看某个进程的负载情况. $ vmstat procs -----------memory--- ...

  2. linux pmap was java,Linux性能测试之pmap命令详解

    pmap命令用于显示一个或多个进程的内存状态,下面通过本文给大家分享Linux性能测试 pmap命令详解,需要的朋友参考下吧 名称: pmap - report memory map of a pro ...

  3. linux性能监控sar命令详解

    语法格式 sar [ 选项 ] [ <时间间隔> [ <次数> ] ] sar -h 显示帮助信息: -A:所有报告的总和 -b:显示I/O和传递速率的统计信息 -B:显示换页 ...

  4. Linux上的free命令详解

    Linux上的free命令详解 转自: http://www.cnblogs.com/coldplayerest/archive/2010/02/20/1669949.html 解释一下Linux上f ...

  5. linux ps(process status) 命令详解

    linux ps(process status) 命令详解 功能说明:报告程序状况. 语 法:ps [-aAcdefHjlmNVwy][acefghLnrsSTuvxX][-C <指令名称> ...

  6. Linux操作系统上lsof命令详解

    Linux操作系统上lsof命令详解 2011-10-08 18:31:31 http://xjsunjie.blog.51cto.com/999372/682865 标签:Linux lsof命令 ...

  7. linux slocate(secure locate) 命令详解

    linux slocate(secure locate) 命令详解 功能说明:查找文件或目录. 语 法:slocate [-u][--help][--version][-d <目录>][查 ...

  8. linux cut命令学习,Linux中的cut 命令详解

    今天小编要跟大家分享的文章是关于Linux中的cut 命令详解.cut 命令在Linux和Unix中的作用是从文件中的每一行中截取出一些部分,并输出到标准输出中.我们可以使用 cut 命令从一行字符串 ...

  9. linux磁盘分区fdisk命令详解及云硬盘挂载实操

    linux磁盘分区fdisk命令详解 1.什么是分区? 分区是将一个硬盘驱动器分成若干个逻辑驱动器,分区是把硬盘连续的区块当做一个独立的磁硬使用.分区表是一个硬盘分区的索引,分区的信息都会写进分区表. ...

最新文章

  1. Android 弱网测试(小米手机切换3g和2g)
  2. 值得深思的问题——分库分表就能无限扩容吗?
  3. php linux权限,Linux权限位
  4. 063_object标签
  5. python 魔法参数*argv 和 **kw
  6. vue2.0 创建项目
  7. ajax php 不影响进程,ajax已并发请求php,但php-fpm却没有如预期fork出多个进程来处理?...
  8. 【caffe-matlab】权重以及特征图的可视化
  9. 将IPFS 配置服务器,电脑连接远程服务器,环境配置
  10. pyqt5 treeview鼠标右键菜单事件_【动手实践】使用 Vue 自定义指令实现右键菜单...
  11. 关于tomcat的思考
  12. python写xml文件_python写入xml文件的方法
  13. git、cocoapod组件化开发常用命令
  14. 学生成绩互帮互助分组C语言,C语言实现—学生成绩管理系统(Linux下运行)
  15. 删除指定路径下的文件以及文件夹
  16. 逻辑回归python sigmoid(z)_python 实现逻辑回归
  17. border英文缩写_第一丶第二丶第三丶第四的英文缩写是什么
  18. 推荐多款好看的报表表单配色方案
  19. Excel2021 如何将左侧A列数据填B列空白处A列数据合并到B列
  20. 老男孩网络安全2021

热门文章

  1. MyBatis-Plus调用插入Insert()方法报错
  2. CATalyst——针对末级缓存侧信道攻击的防御技术
  3. 工作中收集的一些捷径网站
  4. Linux QT下实现简易虚拟键盘
  5. 四个技巧提升你的网站百度收录量
  6. 单词接龙 单词接龙的规则是
  7. allegro 输出gerber文件
  8. maven项目打包报错Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install (default
  9. ITOP4412 OV5640摄像头模块
  10. java分页查询_java实现分页查询