What affects CPU utilization?
You can measure CPU utilization with the iostat or the vmstat tool. The tools can produce a snapshot of the CPU utilization on a system and can be run at regular time intervals to show usage over time. Both tools separate CPU utilization in these categories:
- Percentage of CPU utilization that occurred while executing at the user level.
- Percentage of CPU utilization that occurred while executing at the system or kernal level.
- The percentage of time that the CPU was idle and the system was idle, and the system did not have an outstanding I/O request.
- The percentage of time that the CPU was idle during which the system had an outstanding I/O request.
When is a CPU bound? A CPU is bound if the sum of the user and system time exceeds 90% of the CPU resource on a single-user system or 80% of the CPU resource on a multi-user system.
With the vmstat tool or by looking at the CPU columns, look at the size of the run queue (
kthr - r column). In general, as the run queue increases, users will notice an increase in
response time, and therefore, a decrease in performance.
A high %wait with vmstat or %iowait with iostat indicates potential I/O bottlenecks. It could be that the system is short of memory, so the disks containing paging space might be busy while paging, and you are likely to see a higher run queue as threads are waiting for the CPU.