Performance

Only four resources have much effect on performance:

  • CPU utilization
  • Memory
  • Storage I/O
  • Network I/O

Important

If resources are still left after active processes have taken what they want, the system’s performance is about as good as it can be.

A process that does not have immediate access to the resources it needs has to wait around doing nothing. The amount of time spent waiting is one of the basic measures of performance degradation.

CPU

a faster CPU (or more CPU cores) does make a dramatic difference. But in the everyday world, CPU is actually relatively unimportant.

Disk

Disk bandwidth is a common performance bottleneck

  • it takes many milliseconds to locate a disk block, fetch its contents, and wake up the process that’s waiting for it
  • disk access causes a stall worth millions of CPU instructions

Metrics

The /proc filesystem is the place to find an overview of the hardware:

/proc/cpuinfo   # CPU type and description
/proc/meminfo   # Memory size and usage
/proc/diskstats # Disk devices and usage statistics

sudo dmidecode -t {type} # Desktop Management Interface
sudo dmidecode -t 4

CPU

3 kinds of data is important:

  • overall utilization
  • load averages
  • perprocess CPU
vmstat 5 5 # 5: number of seconds,  5: number of reports

Long-term averages of the CPU statistics let you determine whether there is fundamentally enough CPU power to go around. If the CPU usually spends part of its time in the idle state, there are cycles to spare.

Memory