dstat命令常用参数:
具体参数以man dstat 查看:
-l :显示负载统计量
-m :显示内存使用率(包括used,buffer,cache,free值)
-r :显示I/O统计
-s :显示交换分区使用情况
-t :将当前时间显示在第一行
–fs :显示文件系统统计数据(包括文件总数量和inodes值)
–nocolor :不显示颜色(有时候有用)
–socket :显示网络统计数据
–tcp :显示常用的TCP统计
–udp :显示监听的UDP接口及其当前用量的一些动态数据
当然不止这些用法,dstat附带了一些插件很大程度地扩展了它的功能。你可以通过查看/usr/share/dstat目录来查看它们的一些使用方法,常用的有这些:
-–disk-util :显示某一时间磁盘的忙碌状况
-–freespace :显示当前磁盘空间使用率
-–proc-count :显示正在运行的程序数量
-–top-bio :指出块I/O最大的进程
-–top-cpu :图形化显示CPU占用最大的进程
-–top-io :显示正常I/O最大的进程
-–top-mem :显示占用最多内存的进程
查看内存:
[root@anshen ~]# dstat -g -l -m -s --top-mem
---paging-- ---load-avg--- ------memory-usage----- ----swap--- --most-expensive-
in out | 1m 5m 15m | used buff cach free| used free| memory process
514B 718B|1.00 1.00 1.00|3480M 188M 2916M 904M| 507M 16G|ora_dbw0_qhd 424M
0 0 |1.00 1.00 1.00|3480M 188M 2916M 903M| 507M 16G|ora_dbw0_qhd 424M
0 0 |1.00 1.00 1.00|3480M 188M 2916M 903M| 507M 16G|ora_dbw0_qhd 424M
0 0 |1.00 1.00 1.00|3480M 188M 2916M 903M| 507M 16G|ora_dbw0_qhd 424M
0 0 |1.00 1.00 1.00|3480M 188M 2916M 903M| 507M 16G|ora_dbw0_qhd 424M
0 0 |1.00 1.00 1.00|3480M 188M 2916M 903M| 507M 16G|ora_dbw0_qhd 424M
0 0 |1.00 1.00 1.00|3480M 188M 2916M 903M| 507M 16G|ora_dbw0_qhd 424M
0 0 |1.00 1.00 1.00|3480M 188M 2916M 903M| 507M 16G|ora_dbw0_qhd 424M
0 0 |1.00 1.00 1.00|3480M 188M 2916M 903M| 507M 16G|ora_dbw0_qhd 424M
0 0 |1.00 1.00 1.00|3481M 188M 2916M 903M| 507M 16G|ora_dbw0_qhd 424M
0 0 |1.00 1.00 1.00|3481M 188M 2916M 903M| 507M 16G|ora_dbw0_qhd 424M^C
查看CPU资源使用情况
[root@anshen ~]# dstat -y -c -l --proc-count --top-cpu
---system-- ----total-cpu-usage---- ---load-avg--- proc -most-expensive-
int csw |usr sys idl wai hiq siq| 1m 5m 15m |tota| cpu process
1256 6562 | 2 1 97 0 0 0|1.00 1.00 1.00| 318|osysmond.bin 0.6
6450 8012 | 2 1 97 0 0 0|1.00 1.00 1.00| 318|ora_vktm_qhdb0.7
6562 7744 | 2 1 97 0 0 0|1.00 1.00 1.00| 318|asm_vktm_+ASM0.7
6554 8287 | 2 1 97 0 0 0|1.00 1.00 1.00| 318|ora_vktm_qhdb0.7
7351 8228 | 2 2 96 0 0 0|1.00 1.00 1.00| 318|osysmond.bin 2.0^C
输出一个文件,这个文件可以制作成图表(一般我会利用NMON里面的工具):
[root@anshen tmp]# dstat --output /tmp/anshen.csv
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai hiq siq| read writ| recv send| in out | int csw
2 1 97 0 0 0| 76k 748k| 0 0 | 514B 718B|1255 6562
1 1 98 0 0 0| 18k 78k| 120B 842B| 0 0 |6047 7495
1 0 99 0 0 0| 33k 18k| 120B 362B| 0 0 |6096 7937
1 1 98 0 0 0| 97k 18k| 60B 362B| 0 0 |6014 7601
2 1 96 0 0 0| 17k 106k| 60B 362B| 0 0 |7123 8475
1 1 98 0 0 0| 33k 18k| 120B 362B| 0 0 |6193 7747 ^C
[root@anshen tmp]#
[root@anshen tmp]# l s -l r t
total 620
drwx------ 2 root root 4096 Mar 17 14:26 keyring-Qp72Pv
drwx------ 2 root root 4096 Mar 25 05:19 keyring-coOWVu
drwx------ 2 oracle oinstall 4096 Apr 10 19:15 keyring-WPziOa
drwx------ 2 oracle oinstall 4096 Apr 16 21:55 pulse-zrXOyPovkX6m
drwx------ 2 root root 4096 Jun 23 23:14 keyring-utE3Mv
drwxr-xr-x 2 root root 4096 Aug 25 21:10 hsperfdata_root
drwxr-x--- 2 oracle oinstall 4096 Aug 25 21:18 hsperfdata_oracle
-rw-r--r-- 1 oracle oinstall 589114 Sep 6 02:13 upgrade_info.log
-rw-r--r-- 1 oracle oinstall 2529 Sep 6 21:28 poracle.log
drwxr-xr-x 3 grid oinstall 4096 Sep 11 23:42 CVU_11.2.0.4.0_resource
drwxr-xr-x 2 grid oinstall 4096 Sep 12 01:20 hsperfdata_grid
-rw-r--r-- 1 root root 1762 Sep 12 01:44 anshen.csv
版权声明:本文为博主原创文章,未经博主允许不得转载。
dstat命令常用参数