If you notice that your website is running slowly, the cause may be increased server load. This could be due to a lack of server resources allocated to your website or because your website is under attack. We will investigate and troubleshoot the cause of the increased load.
The "topop" console command is the main tool for this task.
CPU parameter.
The CPU line shows several load parameters at once:
CPU load (parameters “sy”, “us”, “ni”).
By the %CPU column in the output of the "top" command, you can see the processes and make optimizations if necessary. Or just add CPU power to the server.
I/O load ("wa" parameter).
High "wa" values, as well as high LA, indicate idle processes in the D-state due to disk subsystem or network problems.
Simplified state model in Linux.
D-state is a continuous sleep state (processes waiting for an I/O thread to become free).
R-state is the process is currently active (currently running).
S-state is the waiting state (sleeping). It is waiting for some event or signal.
Ò-state is a process suspended by a STOP signal or by executing a trace.
Z-state is "zombie". A process that has terminated its execution but is present on the system to allow the parent process to read the exit code.
You can view the status of system processes using the "ps" command. If you need an extended view, then the "ps aux" command is used.
An example of finding the causes of high "wa" and "load average".
The "ps aux | grep D" command shows processes in the D state.