Tools for Regular Operations124
CPUWhen it comes to monitoring the CPU, we can make use of several tools, such asps. You can see this in use here:
Figure 4.7 – Output of the ps aux command (every process in the system)
The ps command is the de facto standard for checking which process is running, as well as resource consumption usage.
As
for any other command, we could write a lot about all the different command arguments we could use (so, again, check the man page for details, but as a rule, try to learn about their basic usage or the ones that are more useful for you. For anything else, check the manual. For example, ps aux provides enough information for normal usage (every process in the system).
The
top tool, as shown in the following screenshot, refreshes the screen regularly and can sort the output of
running processes, such as CPU usage,
memory usage, and more. In addition, top also shows a five-line summary of memory usage, load average, running processes, and so on:
Checking for free resources – memory and disk (free and df Figure 4.8 – top execution on our test system
CPU usage is not the only thing that may keep our system sluggish. Now, let’s learn a bit about load average indicators.
Load averageLoad average is usually provided as a group of three numbers, such as load average 0.81,
1.00, 1.17, which is the average that’s calculated for 1, 5, and 15 minutes, respectively. This indicates how busy a system is the higher it is, the worse it will respond. The values that are compared for each time frame give us an idea of whether the system load is increasing (higher values in 1 or 5 and lower on 15) or if it is going down (higher at 15 minutes, lower at 5 and 1), so it becomes a quick way to find out if something happened or if it is ongoing. If a system usually has a high load average over 1.00 per CPU, it would be a good idea to dig a bit deeper into the possible causes (too
much demand for its power, not many resources available, and so on).
Now that we have covered the basics, let’s move on and look at some extra checks we can perform on our system resources usage.
Tools for Regular Operations
126
Share with your friends: