Sobes.tech
Middle

The server is very slow. What commands and what should be checked first? If you need to understand why the application does not write logs but the system is alive — where would you look?

sobes.tech AI

Answer from AI

If the server is slow, the first step is to check system resources:

  • top or htop — check CPU load, memory, processes with the highest load.
  • vmstat 1 — monitor memory usage, swap, IO.
  • iostat -xz 1 — check disk activity and delays.
  • free -m — memory and swap status.
  • df -h — free disk space.

If the application does not write logs, but the system is alive:

  • Check permissions and access to log files.
  • Ensure that the disk is not full (df -h).
  • Check if the log file is blocked (e.g., lsof | grep log_name).
  • Check the logging configuration in the application.
  • Check if the logging buffer is full (e.g., if buffering is used).
  • Verify if the logging service has failed (e.g., systemctl status rsyslog or similar).

Thus, first look at system resources, then the state of files and logging configuration.