CentOS服务程序性能评估文档详解

2020-01-30 17:04:01王振洲

-x:查看设备的使用率、响应时间

6 dstat

6.1功能

是一个全能系统信息统计工具,只能对整个系统进行监控而不能对某一个进程或某一个程序进行深入分析;监控项包括:cpu、磁盘、内存、网卡、进程、系统(彩色界面linux下面不多见啊!)

注:此命令需要自行安装(yum install dstat)

6.2命令输出示意图

[root@ShanWei_119_134_255_208 ~]# dstat -cdlmnpy

----total-cpu-usage---- -dsk/total- ---load-avg--- ------memory-usage----- -net/total- ---procs--- ---system--

usr sys idl wai hiq siq| read  writ| 1m   5m  15m | used  buff  cach  free| recv  send|run blk new| int   csw

 3   2  89   6   0   0|  28M 1367k|5.41 5.07 4.87|4019M  172M 58.5G  267M|   0     0 |  0 0.0 1.3|8608    35k

 2   1  85  12   0   0|  21M  828k|5.41 5.07 4.87|4020M  172M 58.6G  243M| 191k   15M|  0 6.0   0|5711    18k

 1   1  80  18   0   0|5828k 4804k|5.41 5.07 4.87|4018M  172M 58.6G  260M| 190k   17M|2.0 3.0   0|5802    12k

6.3命令输出解释

前面基本都解释过了......

6.4常用选项

dstat –cdlmnpsy:cdlmnpsy这几个选项基本囊括了常用的,当然还有很多dstat –-help一下吧。

7 sar

7.1功能

System Activity Reporter系统活动情况报告,是目前 Linux 上最为全面的系统性能分析工具之一,可以从多方面对系统的活动进行报告,包括:文件的读写情况、系统调用的使用情况、磁盘I/O、CPU效率、内存使用状况、进程活动及IPC有关的活动等。

7.2命令输出示意图

[root@localhost ~]# sar -r 1 100

Linux 2.6.32-220.el6.x86_64 (localhost.localdomain)     07/30/2013      _x86_64_        (8 CPU)

03:17:59 PM kbmemfree kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit

03:18:00 PM   4988488   3062224     38.04    639136   2115404     72404      0.44

03:18:01 PM   4984464   3066248     38.09    639136   2115404     98060      0.60

03:18:02 PM   4985152   3065560     38.08    639136   2115420     97972      0.60

03:18:03 PM   4985400   3065312     38.08    639136   2115420     97972      0.60

[root@localhost ~]# sar -B 1 100

Linux 2.6.32-220.el6.x86_64 (localhost.localdomain)     07/30/2013      _x86_64_        (8 CPU)

03:19:09 PM  pgpgin/s pgpgout/s   fault/s  majflt/s  pgfree/s pgscank/s pgscand/s pgsteal/s    %vmeff