collectl

collectl is a performance monitoring tool written in Perl, and similar to sar.

There are some differences noted between collectl and sar, and there is even a sar equivalence matrix. It supports “brief” and “detailed” mode, with a lot of switches available for specifying what subsystems you want to monitor. It can also use gnuplot, httpd and Colplot to plot the results.

For RHEL based Linux flavors, the easiest way to install collectl is via the EPEL repositories. Upon installation, collectl can be run manually via the command line or as a service (use chkconfig to enable it in various run levels, and service collectl start to start the service). In service mode collectl is configured in /etc/collectl.conf and writes log data to /var/log/collectl/ which data can be queried upon.

Here’s an example of manual invocation, brief mode:

$ collectl -i 1 -c 5
waiting for 1 second sample...
#<--------CPU--------><----------Disks-----------><----------Network---------->
#cpu sys inter  ctxsw KBRead  Reads KBWrit Writes   KBIn  PktIn  KBOut  PktOut 
   0   0    19     16      0      0      0      0      0      1      0       0 
   1   1    34     23      0      0     24      6      0      1      0       1 
   0   0    18     17      0      0      0      0      0      1      0       1 
   2   0    36     15      0      0      0      0      2      5      0       4 
  39  21   218     65      0      0      0      0      0      4      1       4

Here’s an example of manual invocation, detailed mode, with different subsystems specified (capital D for detailed disk data):

$ collectl -scnD -c 1
waiting for 1 second sample...

### RECORD    1 >>> pawwa <<< (1386105344.001) (Tue Dec  3 22:15:44 2013) ###

# CPU SUMMARY (INTR, CTXSW & PROC /sec)
# User  Nice   Sys  Wait   IRQ  Soft Steal  Idle  CPUs  Intr  Ctxsw  Proc  RunQ   Run   Avg1  Avg5 Avg15 RunT BlkT
     0     0     0     0     0     0     0   100     1    16     12     0   107     0   0.08  0.02  0.01    0    0

# DISK STATISTICS (/sec)
#          <---------reads---------><---------writes---------><--------averages--------> Pct
#Name       KBytes Merged  IOs Size  KBytes Merged  IOs Size  RWSize  QLen  Wait SvcTim Util
xvdf             0      0    0    0       0      0    0    0       0     0     0      0    0
xvdj             0      0    0    0       0      0    0    0       0     0     0      0    0
xvde             0      0    0    0       0      0    0    0       0     0     0      0    0

# NETWORK SUMMARY (/sec)
# KBIn  PktIn SizeIn  MultI   CmpI  ErrsI  KBOut PktOut  SizeO   CmpO  ErrsO
     0      1     52      0      0      0      0      0      0      0      0

Comments are closed.