⬆️ ⬇️

Convenience of observation, atop

Good day, community,

On Habré, it was already mentioned about all sorts of TOP-based utilities, this time, I want to try to look closer at the atop utility. I will try to compare it a little with existing performance monitoring utilities and learn how to read the findings of this command.

System administrators have the task of monitoring performance almost every day, and of course I would like to do all this within the framework of one utility and without any special dances with a tambourine, it seems to me the most convenient way to use the atop command.



Let's arrange a brief overview on the functionality of the most popular performance viewing utilities. In Linux, there is a rich set of utilities to monitor the system, but each of them has certain limitations and their inherent flaws. Let's try to describe the main parameters that the administrator wants to read from his system:



If we carefully examine these requirements, and try to impose them on all known monitoring systems, we will see the following:

sar - shows more than enough information about the four system resources we need, knows how to “return to the past”, but does not know how to focus on processes.

vmstat and iostat - can monitor the CPU, memory and disk usage only at the system level, but not at the process level, they also do not know how to “return to the past”.

top - as certainly the most popular utility, monitors the CPU and memory at the system level and at the process level. But like many others, it shows only the current situation, the main drawback in my opinion is that its readings are not always accurate, using the top utility, we can encounter such a problem: the system will tell us what to occupy 90% of the CPU, and in fact the amount of CPU load at the process level will be 40% (a difference of 50% percent indicates that the system shows us the information between the previous and the current snapshot, although the system is already free in principle). Ie the reliability and informational content is a bit lame

Below is a table comparing these systems by characteristics.



image



The atop utility by default can show downloads on the processor, memory, disks, and the network. Also available is a patch that will show network usage by process. By default, the standard output of the command is the following information:

')

image



As in the standard top output, the screen is divided into two halves, in the first of them the data on the system are indicated, and in the second data on the processes.

In the upper half, you can see not only the information on the processor and the memory as in the standard top output, but also information on the network and disks. If we pay attention to the 2nd line of this output, summing up the values ​​(3 + 2 + 0 + 195 + 0) we get 200% - this means that the system is 2 processors, and each of them has 100%, the division by each processor, how much this or that busy. Below after these lines are the RAM, information on disks, and network interfaces.

A more detailed description of each column can be found in the man page for this utility, by the way an extremely detailed description.

Naturally, we can change its appearance as we want using hot keys, below I indicated the most interesting of them,

m - builds processes on occupied memory

d - build processes on disk usage

n - builds up processes for using the network (available only with the patch installed)

v - shows more detailed information about the processes (user, date and time of the process start)

u - will build a table for the most voracious users

Using shift + (d, m, n) will build the current list with the above parameters.

i - change the scan time, the default is 10 seconds.

g - returns everything to the default output.

Now let's see how to use the “return to the past” function, the atop utility with a standard installation has such a useful “feature” that includes night logging of the system performance. The utility defaults to readings every 10 minutes, and dumps them into the log / var / log / atop-YYYYMMDD. I have this case disabled by default, the server is not so important:



  [root @ OracleLinux ~] # chkconfig --list |  grep atop
 atop 0: off 1: off 2: off 3: off 4: off 5: off 6: off 




In the future, you can use atop itself with the -r key to analyze or view the log, or if you like reports like sar, you can use the atopsar utility. By the way, it is important to clarify that data is collected in a binary format.

So we can say that at the moment the best utility than atop? which was able to combine in itself almost all the necessary functionality for the system administrator is not. Well, at least this is my personal opinion.

Disclaimers in the comments are welcome!

Source: https://habr.com/ru/post/140010/



All Articles