Atop🔗

Atop is a nice command for figuring out what and when takes up resources. Personally, I use it to have it running in the background of every server I have, and if something goes down, I use atop to go back and see if it was an excessive use of resources, such as disk, memory, or processing; I can then adjust accordingly.

Install atop🔗

Debian based:

apt install atop

CentOS based:

dnf install atop

Start atop🔗

You can launch it with atop, but there is also an atop daemon:

systemctl start atop && systemctl enable atop

Launch with average-per-second total values:

atop -1

Launch with active processes only:

atop -a

Launch with command line per process

atop -c

Launch with disk info

atop -d

Launch with memory info

atop -m

Launch with network info

atop -n

Launch with scheduling info

atop -s

Launch with various info (ppid, user, time)

atop -v

Launch with individual threads

atop -y

Once atop is running, you can press the following keys to sort processes:

Reading log files🔗

Log files are stored, at least on Debian based distros, in /var/log/atop.

To read a file, you can run the following command:

atop -r /path/to/log/file

Type t (lower case!) to go forward 10 minutes, and T (upper case!) to go back 10 minutes.

Specify a specific time by typing b.