Linux performance internals
CPU scheduling, run queues, memory (RSS vs cache, OOM killer), disk I/O, cgroups. The 60-second triage: uptime, dmesg, vmstat, mpstat, iostat, free, sar.
The mental model
A Linux server under load is a factory with four shared conveyor belts: CPU time, memory, disk I/O, and network. Every process is a worker who must queue for a belt. Performance problems are never "the machine is slow" — they are always one specific belt saturated while the other three sit idle, and the workers stack up in a queue you cannot see from the outside.
The reason this topic exists as an SRE discipline: the default instruments lie by omission. "CPU is at 40%" says nothing about whether tasks are stuck waiting for their cgroup quota. "Free memory is low" is usually healthy (the kernel deliberately fills RAM with page cache). Load average on Linux includes tasks in uninterruptible sleep — a load of 90 can mean an NFS server hung, not CPU pressure. Without a mechanical model of the scheduler, the memory hierarchy, and the block layer, you tune the wrong knob, and in an incident you burn the minutes that matter chasing a number that was never the problem.
What breaks without this knowledge is concrete: teams "fix" latency by adding replicas when the real cause is CFS throttling from a mis-set CPU limit; they raise memory limits when the OOM killer was triggered by a cgroup, not the node; they blame the database when the app host is silently swapping. Every one of those wrong turns is avoidable with sixty seconds of the right commands, read correctly.
- Deep dive
- Internal architecture
- Real-world use cases
- Best practices
- Common mistakes
- Performance
- Security
- Production troubleshooting
- Advantages & disadvantages
- Alternatives
- Interview expectations
- Interview questions
- Facts to remember
- Cheat sheet
- Quick revision