Middle
Server diagnostics: how would you act if you connected via SSH to an unfamiliar server that is slow?
sobes.tech AI
Answer from AI
When connecting via SSH to an unfamiliar server that is slow, I would act as follows:
-
Load check:
toporhtop— check CPU load, memory, processes.uptime— find out the average load over 1, 5, 15 minutes.
-
Memory and swap:
free -m— check the usage of RAM and swap.
-
Disk activity:
iostatoriotop— check if the disk is overloaded.df -h— check free space on disks.
-
Network resources:
netstat -tulnporss -tulnp— view open ports and active connections.iftop— monitor network traffic.
-
Logs:
- Review system logs (
/var/log/syslog,/var/log/messages) for errors.
- Review system logs (
-
Processes:
- Identify processes with high load (
ps aux --sort=-%cpu).
- Identify processes with high load (
-
Check for locks:
dmesg— view system messages related to hardware.
-
Action plan:
- If the problem is with a specific process — restart or optimize it.
- If resources are exhausted — possibly increase resources or optimize configuration.
This systematic approach helps quickly localize the cause of slowdowns and take measures.