The core Linux SRE/DevOps screen: processes, threads, signals, /proc/meminfo, load average, page faults, file descriptors, ss backlog, namespaces & cgroups, containers vs VMs.
The bread-and-butter Linux screen for an SRE/DevOps role: fast, correct answers about processes, memory, the network stack, and how you'd actually debug a box. Grouped the way interviewers ask them.
| Question | Answer |
|---|---|
| Monitoring/debug utilities you reach for | top/htop/atop, vmstat, iostat, ss, lsof, dstat, sar, strace, tcpdump. Be ready to go deep on one (e.g. atop records historical per-process CPU/mem/disk). |
| How much RAM (total/used/free) | free -m, vmstat, cat /proc/meminfo, top/htop/atop. |
| How many CPU cores | nproc, lscpu, cat /proc/cpuinfo, getconf _NPROCESSORS_ONLN; in top press 1. |
| Files opened by a process | lsof -p <pid> or ls -l /proc/<pid>/fd. |
| Free space on a filesystem | df -h (blocks), df -i (inodes), stat -f <path>. |
| Time since last boot | uptime, w, who -b, cat /proc/uptime. |
| Test a remote port | nc -vz <host> <port>, telnet <host> <port>, curl -v host:port, nmap -p <port> <host>. |
| Check for hardware problems | dmesg (ring buffer), logs under /var/log/ (kern.log, messages, syslog); smartctl for disks, mcelog/EDAC for RAM/CPU. |
| One-shot process list | ps ax; start time with ps axo lstart,args. |
| Debug the network stack | tcpdump (capture), plus ss, ip, ethtool. |
| OSI order of ip, ethernet, tcp, icmp, http, dns | ethernet (L2) → ip, icmp (L3) → tcp, udp (L4) → http, dns (L7). DNS rides UDP and TCP. |
| TCP port range | 0–65535 (16-bit). |
| TCP connections per HTTP request/response | One (HTTP/1.1 keep-alive reuses it for many requests). |
What ping does | Tests reachability of a destination IP via ICMP Echo Request/Reply. |
free -m — memory in MB. Look at available (not free): that's
what you can allocate without swapping.
total used free shared buff/cache available
Mem: 15884 3921 412 88 11550 11421
Swap: 2047 0 2047
nproc / lscpu — logical CPU count / full topology (sockets, cores,
threads, NUMA).
$ nproc
8
$ lscpu | grep -E 'Socket|Core|Thread|CPU\(s\):'
CPU(s): 8
Thread(s) per core: 2
Core(s) per socket: 4
Socket(s): 1
df -h / df -i — blocks / inodes. A full df -h with
an idle df -i = a space problem; the reverse = inode exhaustion.
$ df -h / Size Used Avail Use% Mounted on
40G 34G 6.0G 86% /
$ df -i / Inodes IUsed IFree IUse% Mounted on
2.6M 148K 2.4M 6% /
ss -ltnp — listening TCP sockets with the owning process. For a LISTEN socket,
Recv-Q = current accept-queue depth, Send-Q = the backlog (max).
State Recv-Q Send-Q Local Address:Port Process
LISTEN 0 511 0.0.0.0:80 users:(("nginx",pid=1201,fd=6))
LISTEN 0 128 0.0.0.0:22 users:(("sshd",pid=812,fd=3))
lsof -p <pid> / ls /proc/<pid>/fd — every open file/socket
a process holds (count them against its limit).
$ ls /proc/1201/fd | wc -l
42
$ lsof -p 1201 | awk '{print $5}' | sort | uniq -c | sort -rn | head -3
28 IPv4 # sockets
9 REG # regular files
3 CHR
uptime — time since boot + the 1/5/15-min load average (compare to core count).
$ uptime
14:22:07 up 37 days, 4:12, 2 users, load average: 1.20, 0.98, 0.71
ps axo lstart,args — process list with exact start time (spot a process that
restarted, or has been up suspiciously long).
$ ps -eo pid,ppid,stat,etime,comm | head -3
PID PPID STAT ELAPSED COMMAND
1 0 Ss 37-04:12 systemd
1201 1 Ss 37-04:10 nginx
dmesg -T | tail — kernel ring buffer (human timestamps): OOM kills, disk resets,
link flaps, hardware errors.
[Tue Aug 25 03:11:20 2026] Out of memory: Killed process 8842 (java) ...
[Tue Aug 25 03:11:20 2026] oom_reaper: reaped process 8842 (java) ...
/proc/meminfofree is just a friendly view of this file. The fields interviewers probe:
| Field | Meaning |
|---|---|
MemFree | Truly unused RAM. Usually small — Linux deliberately uses free RAM for cache. |
MemAvailable | The number that matters: estimate of allocatable memory without swapping (free + reclaimable cache). Use this, not MemFree, to judge pressure. |
Buffers | Kernel block-I/O buffers (filesystem metadata) — small. |
Cached | Page cache: file contents held in RAM; reclaimable under pressure. |
Active/Inactive (anon/file) | Anon = allocated process memory (heap/stack, needs swap to evict). File = page cache (can just be dropped). Inactive = eviction candidates. |
Dirty / Writeback | File data modified in cache but not yet on disk (Dirty), or being flushed now (Writeback). |
Mlocked | Memory pinned via mlock() so it can't be swapped (keys, latency-sensitive maps). |
Slab / SReclaimable | Kernel object caches (dentries/inodes); the reclaimable part frees under pressure. |
SwapTotal/SwapFree | Swap capacity/free. Heavy swap use = memory pressure. |
Committed_AS vs CommitLimit | Total memory promised to processes vs the overcommit ceiling — approaching the limit risks allocation failures / the OOM killer. |
HugePages_*, AnonHugePages | Large (2 MiB/1 GiB) pages — fewer TLB misses for databases/JVMs. |
Load average (the 1/5/15-minute numbers in uptime) is the average number of tasks
runnable or waiting over that window. Compare it to core count: load 8 on 8 cores ≈ fully busy.
D-state (uninterruptible, usually disk/IO) tasks — so a NFS/disk stall inflates load with
near-zero CPU use. Classic BSD load counts only CPU run-queue demand, not I/O wait.iostat -xz 1 and D-state counts.clone(); user threads are
backed by libpthread.strace -p <pid>.R running/runnable, S interruptible sleep,
D uninterruptible sleep (in a syscall, usually I/O — can't be killed until it returns),
Z zombie (exited, parent hasn't wait()ed — only a PID-table entry), T stopped.ps STAT letters)The first letter is the state; the rest are modifiers. ps -eo pid,stat,comm /
ps aux show them.
| Code | State | Meaning |
|---|---|---|
R | Running / runnable | On a CPU, or on a run queue ready to run. |
S | Interruptible sleep | Waiting for an event; wakeable by a signal. The common idle state. |
D | Uninterruptible sleep | Blocked in a syscall (usually I/O); signals don't wake it — not even SIGKILL. Persistent D = stuck I/O (hung NFS, bad disk). |
Z | Zombie (<defunct>) | Exited, waiting for the parent to wait(). Holds only a PID slot; fix the parent, not the zombie. |
T | Stopped | Job-control stop (SIGSTOP/Ctrl-Z) or a ptrace stop. |
t | Traced | Stopped by a debugger (ptrace). |
I | Idle kernel thread | An idle D-like kernel thread (not counted in load average). |
X | Dead | About to be reaped (rarely seen). |
| Modifier | Meaning |
|---|---|
< | High priority (negative nice). |
N | Low priority (positive nice). |
s | Session leader. |
l | Multi-threaded. |
+ | In the foreground process group. |
L | Has pages locked in memory (mlock). |
So Ssl = interruptible-sleep, session-leader, multithreaded (a typical daemon); R+ =
running in the foreground. The two that page you: D (stuck I/O) and Z (parent not
reaping) — both resist kill -9 for different reasons; see
Linux Troubleshooting and
Processes.
| Signal | Num | Meaning |
|---|---|---|
SIGHUP | 1 | Terminal hangup; by convention "reload config" for daemons. |
SIGINT | 2 | Ctrl-C. |
SIGKILL | 9 | Force kill — uncatchable, no cleanup. |
SIGTERM | 15 | Default kill; graceful shutdown (catchable). |
SIGSTOP/SIGCONT | 19/18 | Pause / resume (STOP is uncatchable). |
SIGUSR1/SIGUSR2 | 10/12 | User-defined — apps assign their own meaning (e.g. re-open logs). |
A signal is an asynchronous notification to a process — a basic IPC mechanism.
ps -o maj_flt, sar -B) signals
memory pressure / thrashing.deleted flagA file descriptor is a per-process handle to an open file/socket/pipe. When lsof -p <pid> shows
a path marked (deleted), the directory entry was removed but a process still holds the
fd open — so the inode and its disk blocks aren't freed yet. Classic cause: bad log rotation
— the file is unlinked but the daemon keeps writing to the old fd, so df stays full while
du can't find the space. Fix: signal the app to re-open (copytruncate or
postrotate). See also Linux Basics.
ss -lna and the backlogFor a TCP socket in LISTEN, the two queue columns aren't bytes:
| Column | For a LISTEN socket |
|---|---|
Recv-Q | Number of established connections waiting to be accept()ed (the current accept-queue depth). |
Send-Q | The backlog — max size of that accept queue (listen() backlog, capped by net.core.somaxconn). |
When the accept queue is full (app too slow to accept()), new connections are dropped:
the final ACK is ignored, so the client retransmits and eventually times out — and
net.ipv4.tcp_abort_on_overflow / ListenOverflows counters climb
(nstat, netstat -s).
The kernel primitives behind containers:
| Namespace | Isolates |
|---|---|
PID | Process tree (PID 1 inside the container). |
NET | Interfaces, routing table, iptables, sockets. |
MNT | Mount points / filesystem view. |
UTS | Hostname & domain name. |
IPC | SysV IPC, POSIX shared memory / semaphores. |
USER | UID/GID mapping (root inside ≠ root outside). |
CGROUP | The cgroup filesystem view. |
Namespaces decide what a process can see; cgroups decide
how much it can use (CPU, memory, IO, PIDs) and account for it. cgroup v2 is the unified hierarchy.
Inspect with lsns, nsenter, systemd-cgls, systemd-cgtop.
The single most-asked ops question, so answer it in one line first: a VM virtualizes the hardware and runs its own kernel + OS; a container virtualizes the OS and shares the host's kernel. A VM is a fake machine (courtesy of a hypervisor); a container is just an isolated process (courtesy of namespaces + cgroups).
Container = namespaces (what it can see) + cgroups (how much it can use) + an image (userspace + deps), all running on the host kernel. VM = a hypervisor (KVM, ESXi, Hyper-V) giving a guest virtual CPU/RAM/disk/NIC, on which a full guest OS boots its own kernel.
| Container | Virtual machine | |
|---|---|---|
| Virtualizes | The OS (a process view) | The hardware (a whole machine) |
| Kernel | Shares the host kernel | Own guest kernel per VM |
| Isolation by | Namespaces + cgroups | Hypervisor + CPU virtualization (VT-x/AMD-V) |
| Start time / overhead | Milliseconds; process-light | Seconds; boots a kernel, GBs of RAM/disk |
| Image size | MBs (userspace + deps) | GBs (whole OS disk image) |
| Density | Hundreds per host | Tens per host |
| Isolation strength | Weaker — shared kernel is the blast radius | Stronger — hardware-enforced boundary |
| Guest OS | Must match host kernel (Linux on Linux) | Any OS (Windows on Linux, etc.) |
Under the hood a container is exactly the namespaces & cgroups from the section above — no magic, just kernel features.
/dev/sdb) with dd, or let a database/LVM use raw block storage. A filesystem
is just one consumer of the block layer./etc/passwd and /etc/shadow separate?
/etc/passwd is world-readable (many tools resolve names/UIDs from it), so password hashes were moved
to /etc/shadow, readable only by root — keeping hashes off a file every process can read.strace (syscalls) / ltrace (library calls).