CHAPTER THREE

Measurement: Units of Capacity

The only man who behaves sensibly is my tailor; he takes my measurements anew every time he sees me, while all the rest go on with their old measurements and expect me to fit them.

George Bernard Shaw

Image

If you don’t have a way to measure current capacity, you can’t conduct capacity planning—you would only be guessing. Fortunately, a seemingly endless range of tools is available for measuring computer performance and usage. Most operating systems come with some basic built-in utilities that can measure various performance and resource consumption metrics. Most of these utilities usually provide a way to record results, as well. For instance, on Linux, the following commands are commonly used: 

uptime

You use this to view the load averages, which in turn indicates the number of tasks (processes) that are queued up to run. For links to the discussions about understanding uptime, go to the section “Resources”.

dmesg

You use this to view the last 10 system messages, if there are any, and look for errors that can cause performance issues.

vmstat 1

This provides a summary of key server statistics—such as processes running on the CPU and waiting for a turn, free memory in kilobytes, swap-ins, and swap-outs—every second.

mpstat –P ALL 1

This provides CPU time breakdowns per CPU every second.

pistat 1

This provides ...

Get The Art of Capacity Planning, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.