天天看點

pidstat 統計程序、線程、程序組的資源消耗

postgresql , linux , pidstat

如果我們要檢視linux下面程序、程序組、線程的資源消耗的統計資訊,可以使用pidstat,它可以收集并報告程序的統計資訊。

pidstat實際上也是将/proc/pid下的統計資訊統籌後展現給使用者。

1. 列出io統計資訊:-d

2. 列出記憶體使用統計,page fault:-r

3. cpu統計資訊:-u

4. 上下文切換統計資訊:-w

5. 指定輸出的次元

指定指令: -c command

指定程序号:-p { pid [,...] | self | all }

将所有列輸出到單行、便于導入單張表中:-h

按每個cpu核的統計:-i

按所有cpu核統計:預設

列出指令的完整内容,包括參數:-l

列出線程統計資訊:-t

按程序次元單獨統計、按程序全局+子程序單獨統計、按程序全局、單獨統計同時按子任務單獨統計:-t { task | child | all }

執行個體,統計5秒的值并輸出

man pidstat

<a href="http://linoxide.com/linux-command/linux-pidstat-monitor-statistics-procesess/">http://linoxide.com/linux-command/linux-pidstat-monitor-statistics-procesess/</a>

<a href="http://www.cnblogs.com/ggjucheng/archive/2013/01/13/2858874.html">http://www.cnblogs.com/ggjucheng/archive/2013/01/13/2858874.html</a>

<a href="http://www.2cto.com/os/201306/217190.html">http://www.2cto.com/os/201306/217190.html</a>

繼續閱讀