b - buddy info (内存片段) c - CPU d - Disk f - NFS V3 Data i - Inode and File System j - Interrupts l - Lustre m - Memory n - Networks s - Sockets t - TCP x - Interconnect y - Slabs (systemobject caches)
C - CPU D - Disk E - Environmental data (fan, power, temp), via ipmitool F - NFS Data J - Interrupts L - Lustre OST detail OR client Filesystem detail M - Memory node data, which isalso known as numa data N - Networks T - 65 TCP counters only available in plot format X - Interconnect Y - Slabs (systemobject caches) Z - Processes
使用“-s”来监测特定的子系统并向其添加子系统的识别项。现在让我们举几个例子。
1. 监测cpu使用率
用“-sc”实现CPU总使用率的监测
1 2 3 4 5 6 7
$ collectl -sc waiting for 1 second sample... #<--------CPU--------> #cpu sys inter ctxsw 3 0 1800 3729 3 0 1767 3599
Miscellaneous (best when used with--procfilt) cpu cpu number pid process pid thread total process threads (not counting main)
TOP SLAB SORT FIELDS
numobj total numberof slab objects actobj active slab objects objsize sizes of slab objects numslab numberof slabs objslab numberof objects ina slab totsize total memory sizes taken by slabs totchg change in memory sizes totpct percent change in memory sizes name slab names
8. 像top一样使用collectl
为使collectl像top,我们只需以CPU使用率排序输出进程。
1 2
$ collectl --top
输出如下
1 2 3 4 5 6 7 8 9 10
# TOP PROCESSES sorted by time (counters are /sec) 14:08:46 # PID User PR PPID THRD S VSZ RSS CP SysT UsrT Pct AccuTime RKB WKB MajF MinF Command 9471 enlighte 2091020 R 63M 22M 30.030.101300:00.810003 /usr/bin/perl 3076 enlighte 2026832 S 521M 40M 20.000.03300:55.140002 /usr/bin/yakuake 3877 enlighte 20335641 S 1G 218M 10.000.03310:10.500000 /opt/google/chrome/chrome 4625 enlighte 20289536 S 1G 241M 20.000.02208:24.3900012 /usr/lib/firefox/firefox 5638 enlighte 2033563 S 1G 265M 10.000.02209:55.040002 /opt/google/chrome/chrome 1186 root 2011524 S 502M 76M 00.000.01103:02.960000 /usr/bin/X 1334 www-data 2013290 S 87M 1M 20.000.01100:00.850000 nginx: