溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Linux系統(tǒng)中dstat工具的常見用法總結(jié)

發(fā)布時(shí)間:2021-09-15 16:44:34 來源:億速云 閱讀:144 作者:chen 欄目:系統(tǒng)運(yùn)維

這篇文章主要講解了“Linux系統(tǒng)中dstat工具的常見用法總結(jié)”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“Linux系統(tǒng)中dstat工具的常見用法總結(jié)”吧!

1) 工具說明
dstat是一個(gè)用來替換 vmstat,iostat netstat,nfsstat和ifstat這些命令的工具, 是一個(gè)全能系統(tǒng)信息統(tǒng)計(jì)工具. 與sysstat相比, dstat擁有一個(gè)彩色的界面, 在手動(dòng)觀察性能狀況時(shí), 數(shù)據(jù)比較顯眼容易觀察; 而且dstat支持即時(shí)刷新, 譬如輸入dstat 3, 即每三秒收集一次, 但最新的數(shù)據(jù)都會(huì)每秒刷新顯示. 和sysstat相同的是, dstat也可以收集指定的性能資源。

2) 軟件安裝

代碼如下:


# cd /tmp
# rz
# rpm -Uvh dstat-0.6.7-1.el*.rf.noarch.rpm
# which dstat
/usr/bin/dstat


或者Ubuntu(Debian系)下:

代碼如下:


$ apt-get install dstat


3) dstat 選項(xiàng)

-C 0,3,total include cpu0, cpu3 and total
-d, -disk 顯示磁盤情況
-D total,hda include hda and total
-g, -page enable page stats
-i, -int enable interrupt stats
-I 5,eth3 include int5 and interrupt used by eth3
-l, -load enable load stats
-m, -mem 顯示內(nèi)存情況
-n, -net 顯示網(wǎng)絡(luò)情況
-N eth2,total 可以指定網(wǎng)絡(luò)接口
-p, -proc enable process stats
-s, -swap 顯示swap情況
-S swap1,total 可以指定多個(gè)swap
-t, -time enable time counter
-y, -sys enable system stats
-ipc 報(bào)告IPC消息隊(duì)列和信號(hào)量的使用情況
-lock enable lock stats
-raw enable raw stats
-tcp enable tcp stats
-udp enable udp stats
-unix enable unix stats
-M stat1,stat2 enable external stats
-mods stat1,stat2
-a, -all 使用-cdngy 缺省的就是這樣顯示
-f, -full 使用 -C, -D, -I, -N and -S 顯示
-v, -vmstat 使用-pmgdsc -D 顯示
-integer show integer values
-nocolor disable colors (implies -noupdate)
-noheaders 只顯示一次表頭以后就不顯示了,使用重定向?qū)懭胛募r(shí)很有用
-noupdate disable intermediate updates
-output file 寫入到CVS文件中
這個(gè)軟件和vmstat很像, 不過和vmstat相比好像少了io部份的顯示, dstat只能顯示磁盤的吞吐量而不是顯示負(fù)載情況, dstat和幾乎所有監(jiān)控軟件一樣, 只能對(duì)整個(gè)系統(tǒng)進(jìn)行監(jiān)控而不能對(duì)某一個(gè)進(jìn)程或某一個(gè)程序進(jìn)行深入分析. 我常使用的參數(shù)是dstat -cdlmnpsy, 做個(gè)別名鏈接alias dstat='dstat -cdlmnpsy'

4)常見用法
查看有關(guān) cpu,硬盤和網(wǎng)絡(luò)的詳細(xì)信息。

代碼如下:


$dstat

Linux系統(tǒng)中dstat工具的常見用法總結(jié)

查看有關(guān) cpu,硬盤和網(wǎng)絡(luò)的詳細(xì)信息。

-c cpu

代碼如下:


$ dstat -c

Linux系統(tǒng)中dstat工具的常見用法總結(jié)

-d 磁盤

代碼如下:


$ dstat -d

Linux系統(tǒng)中dstat工具的常見用法總結(jié)

顯示 cpu、磁盤等的詳細(xì)信息。

代碼如下:


$ dstat -cdl -D sda1

Linux系統(tǒng)中dstat工具的常見用法總結(jié)

感謝各位的閱讀,以上就是“Linux系統(tǒng)中dstat工具的常見用法總結(jié)”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對(duì)Linux系統(tǒng)中dstat工具的常見用法總結(jié)這一問題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是億速云,小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI