Monitoring the CPU
Modern CPUs generally do not become bottlenecks for performance. The processing power is still far ahead of the data transfer speeds of I/O devices and networks. Generally, the CPU spends a big part of processing time waiting for synchronous IO to fetch data from the disk or from a network device. Tracking exact CPU usage is quite a confusing task. Most of the time, you will find higher CPU use, but in reality, the CPU is waiting for data to become available.
In this recipe, we will focus on tracking CPU performance. We will look at some common tools used to get CPU usage details.
Getting ready
You may need sudo
privileges to execute some commands.
How to do it…
Let's start with the most commonly used monitoring command that is top
command. The top
command shows a summarized view of various resource utilization metrics. This includes CPU usage, memory and swap utilization, running processes, and their respective resource consumption, and so on. All metrics are...