Measuring a complete workload on a dedicated system

Using a dedicated system is the ideal situation because we can use measurements that include system overhead as well as the cost of individual processes.

To measure overall system performance for most of the system activity, use the vmstat command:
# vmstat 5 >vmstat.output
This gives us a picture of the state of the system every 5 seconds during the measurement run. The first set of vmstat output contains the cumulative data from the last boot to the start of the vmstat command. The remaining sets are the results for the preceding interval, in this case 5 seconds. A typical set of vmstat output on a system looks similar to the following:
kthr     memory             page              faults        cpu
----- ----------- ------------------------ ------------ -----------
 r  b   avm   fre  re  pi  po  fr   sr  cy  in   sy  cs us sy id wa
 0  1 75186   192   0   0   0   0    1   0 344 1998 403  6  2 92  0
To measure CPU and disk activity, use the iostat command:
# iostat 5 >iostat.output
This gives us a picture of the state of the system every 5 seconds during the measurement run. The first set of iostat output contains the cumulative data from the last boot to the start of the iostat command. The remaining sets are the results for the preceding interval, in this case 5 seconds. A typical set of iostat output on a system looks similar to the following:
tty:      tin         tout   avg-cpu:  % user    % sys     % idle    % iowait
          0.0          0.0              19.4      5.7       70.8       4.1

Disks:        % tm_act     Kbps      tps    Kb_read   Kb_wrtn
hdisk0           8.0      34.5       8.2         12       164
hdisk1           0.0       0.0       0.0          0         0
cd0              0.0       0.0       0.0          0         0
To measure memory, use the svmon command. The svmon -G command gives a picture of overall memory use. The statistics are in terms of 4 KB pages:
# svmon -G

               size      inuse       free        pin    virtual
memory        65527      65406        121       5963      74711
pg space     131072      37218

               work       pers       clnt        lpage
pin            5972          0          0            0
in use        54177       9023       2206            0
In this example, the machine's 256 MB memory is fully used. About 83 percent of RAM is in use for working segments, the read/write memory of running programs (the rest is for caching files). If there are long-running processes in which we are interested, we can review their memory requirements in detail. The following example determines the memory used by a process of user hoetzel.
# ps -fu hoetzel
     UID   PID  PPID   C    STIME    TTY  TIME CMD
 hoetzel 24896 33604   0 09:27:35  pts/3  0:00 /usr/bin/ksh
 hoetzel 32496 25350   6 15:16:34  pts/5  0:00 ps -fu hoetzel

# svmon -P 24896

------------------------------------------------------------------------------
     Pid Command        Inuse      Pin     Pgsp  Virtual   64-bit    Mthrd    LPage
   24896 ksh             7547     4045     1186     7486        N        N        N

  Vsid     Esid Type Description           LPage   Inuse   Pin Pgsp Virtual
     0        0 work kernel seg                -    6324  4041 1186  6324
6a89aa        d work shared library text       -    1064     0    0  1064
72d3cb        2 work process private           -      75     4    0    75
401100        1 pers code,/dev/hd2:6250        -      59     0    -     -
 3d40f        f work shared library data       -      23     0    0    23
16925a        - pers /dev/hd4:447              -       2     0    -     -

The working segment (5176), with 4 pages in use, is the cost of this instance of the ksh program. The 2619-page cost of the shared library and the 58-page cost of the ksh program are spread across all of the running programs and all instances of the ksh program, respectively.

If we believe that our 256 MB system is larger than necessary, use the rmss command to reduce the effective size of the machine and remeasure the workload. If paging increases significantly or response time deteriorates, we have reduced memory too much. This technique can be continued until we find a size that runs our workload without degradation. See Memory requirements assessment with the rmss command for more information on this technique.

The primary command for measuring network usage is the netstat program. The following example shows the activity of a specific Token-Ring interface:
# netstat -I tr0 5
   input    (tr0)     output            input   (Total)    output
 packets  errs  packets  errs colls   packets  errs  packets  errs colls
35552822 213488 30283693     0     0  35608011 213488 30338882     0     0
     300     0      426     0     0       300     0      426     0     0
     272     2      190     0     0       272     2      190     0     0
     231     0      192     0     0       231     0      192     0     0
     143     0      113     0     0       143     0      113     0     0
     408     1      176     0     0       408     1      176     0     0

The first line of the report shows the cumulative network traffic since the last boot. Each subsequent line shows the activity for the preceding 5-second interval.