Quick search
Search

VPS/VDS load search.

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.

top

The "top" program gives you a real-time view of the running system.
Connect to your server via SSH to run the program. Next, type the command "top" and press the "Enter" key. All running server processes will be displayed after starting the program.

Resources used information is displayed at the top. List of running processes at the bottom. Let's analyze several parameters displayed by the program.
The average system load over a period of time is referred to as Load Average (LA). Three values show the averaged load over the last 1, 5, and 15 minutes. There are many contradictory articles on what value to consider normal. The load indicator is estimated by the number of cores in the system. A value of 0 is an idle core and 1 is a full core load.

CPU parameter.
The CPU line shows several load parameters at once:

  • us (user) - CPU usage by user processes.
  • sy (system) - CPU usage by system processes.
  • ni (nice) - CPU usage by priority changed processes using the "nice" command.
  • id (idle) - CPU idle is free resources.
  • wa (IO-wait) - reports I/O related downtime
  • hi (hardware interrupts) - indicates the CPU time used to service the hardware interrupt.
  • si (software interrupts) - indicates the CPU time used to service the software interrupt.
  • st (stolen by the hypervisor) - indicates the CPU time used by the hypervisor.

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.