A restart can restore service, but it also erases clues: the process tree changes, in-memory counters disappear, and the slow request may never recur on demand. These ten commands help you take a quick, mostly read-only snapshot first. They are a starting point for a Linux host, not a promise that every distribution installs every tool. Avoid copying full logs or process arguments into public tickets; they can contain secrets.

1. uptime

Start with load averages and how long the machine has been running. A sudden rise compared with the machine’s normal baseline suggests contention, but load average includes tasks waiting for some kinds of I/O and is not the same as CPU percentage. Compare it with the number of CPUs and the next few checks before assigning a cause. Source: Linux uptime manual.

2. free -h

See available memory and swap use. Linux uses spare RAM for caches, so “free” memory near zero is not proof of trouble. Watch the available estimate and swap activity. A machine that is constantly paging may feel slow even when a short CPU snapshot looks calm. Source: Linux free manual.

3. vmstat 1

A few one-second samples show run queue, memory pressure, swap in/out, and CPU wait together. Ignore the first line as a recent average when interpreting a fresh incident. Persistent swap activity or I/O wait points you toward a different investigation than a busy user-space CPU column. Source: Linux vmstat manual.

4. top

Find which processes are using CPU or memory right now. Sort by the resource that matches the symptom and note the process ID before it disappears. A single hot process may be expected during a batch job; correlate it with user latency and deployment timing before killing anything. Source: Linux top manual.

5. ps

Take a repeatable snapshot of process state, start time, and parent process when an interactive view moves too quickly. A process stuck in uninterruptible sleep suggests you should inspect I/O rather than repeatedly sending it signals. Be cautious when sharing command lines, which may expose tokens passed as arguments. Source: Linux ps manual.

6. df -h

Check whether a mounted filesystem is full. A nearly full root filesystem can break logs, package updates, and database writes even if the application volume looks fine. Also inspect inode exhaustion with df -i when many tiny files are involved. Confirm the affected mount before deleting any files. Source: df manual.

7. du -sh on a known path

If a filesystem is full, measure specific directories such as the application log directory or a cache volume. Scanning the entire root tree can be slow and cross mounted volumes, so narrow the path and use the same filesystem where practical. A large directory is evidence to investigate, not automatic permission to erase it. Source: du manual.

8. ss -tlnp

List listening TCP sockets and the owning processes to check whether a service bound the expected port. This does not prove a remote client can reach it: firewall rules, a proxy, TLS, and application health still matter. Use a separate connection test from outside the host before declaring a network path healthy. Source: Linux ss manual.

9. journalctl -u service

Read the unit’s recent logs around the time the problem began. Use a bounded time window and follow the unit actually managing the process. A containerized service may write to a container log instead; first determine where its logs go. Protect logs because exception messages and request metadata can expose customer data. Source: systemd journalctl manual.

10. dmesg

Kernel messages can reveal out-of-memory kills, disk errors, and driver trouble that the application log never saw. The output may be restricted to privileged users. A kernel OOM message is a clue to inspect cgroup limits and memory use, not a reason to disable limits blindly. Source: Linux dmesg manual.

How to use this list

Write down timestamps and the commands you ran. If you must restart to restore users quickly, capture enough evidence first to explain why the restart helped. Follow up with the slow request, deployment marker, and resource graphs; a command snapshot is most useful when it can be connected to the user-facing symptom.

Sources and scope

Each entry links to primary documentation or project guidance. Check current versions and browser compatibility before applying a technique to a production system.

More on Cloud & DevOps →