Skip to content
Linux system performance · Chapter 1 of 21 Introduction

Introduction

What this course is about

“The server is slow.” Every administrator and every developer hears this sentence at some point – usually without a number, without a time and with the expectation that it will be fast again in a minute. What often follows is guessing: you restart the service, give the VM more memory, turn a kernel parameter you found in a forum. Sometimes it helps. Most of the time nobody knows why afterwards – and next time the guessing starts all over again.

This course teaches you not to guess. A Linux system tells you very precisely where it loses time: in counters under /proc, in the scheduler statistics, in every request to a disk and in every packet that gets lost. You learn to query this information in a fixed order, to read the numbers correctly and to narrow a cause down so far that you can prove it – with one measurement before and one after.

You do not work with slides but on two virtual machines of your own. On one of them you build in faults that really happen in practice – a swap storm, a process stuck in state D, a full connection table, a service slowed down by a cgroup – and find them again with the tools of the day. The other one generates load and acts as the remote end on the network.

What you learn

At the end of the course you can:

  • ask a performance question properly: tell latency, throughput, utilization, saturation and errors apart and explain which of them matters for the problem,
  • check every resource of a Linux host systematically with the USE method (Utilization, Saturation, Errors) instead of chasing the first suspicion,
  • assess an unknown server with a 60-second check made of ten commands,
  • read the output of vmstat, mpstat, pidstat, iostat, sar, free and ss column by column – and know where they mislead you (load average, %util, “free” memory),
  • use Pressure Stall Information (PSI) to see how long tasks wait for CPU, memory and I/O,
  • profile programs with perf and read flame graphs, including the time in which a program is not running (off-CPU analysis),
  • classify memory problems: page cache, RSS and PSS, page faults, swap, reclaim and the OOM killer,
  • measure file system and disk latency and follow a hanging process down to the waiting request,
  • build honest benchmarks with fio and stress-ng – and recognize when a benchmark measures the cache instead of the disk,
  • find network problems between two hosts: retransmits, connection setup, backlogs, conntrack, softirq,
  • look into the kernel with ftrace, perf trace, bcc and bpftrace without rebuilding it – and estimate what that costs,
  • limit resources with cgroups v2, tame a “noisy neighbour” and back every tuning measure with measurements.

Why this course

Because “more hardware” is rarely the answer. A VM twice the size costs twice as much and does not help if a process waits for a single lock or writes every line with fsync. Whoever finds the bottleneck saves money and time – and can justify it.

Because the tools are already there. Since Ubuntu 24.04, perf, sysstat, the bcc tools and bpftrace are part of the standard server installation, and the system libraries are built with frame pointers so that profiles show complete call chains. You do not need special software; you need to know which tool answers which question.

Because eBPF has changed troubleshooting. A few years ago, many questions required rebuilding the kernel or stopping a program in a debugger. Today a one-liner in bpftrace answers questions such as “Which process is waiting for the disk right now, and for how long?” – in production and at low cost.

Because you will meet it in every operations team. Database, web server, Kubernetes node or build server: underneath runs a Linux kernel, and the questions are always the same. What you learn here on a single host applies wherever Linux runs.

Who this course is for

For administrators, site reliability engineers, platform teams and developers who want to understand why their system is slow. You should

  • find your way around the Linux command line (create files, start programs, SSH, sudo),
  • roughly know what a process, a file and a network connection are.

You do not have to program. Where the course uses small programs in C or Python to create a fault, the complete source code is shown and explained line by line. You do not need kernel knowledge either – whatever you need is explained in the chapter where it comes up.

How the course is structured

The course has 17 chapters – “days” – and three appendices. A day takes two to three hours.

Day Topic
0 The lab grounds: two VMs, tools, a baseline
1 Methodology: how to ask a performance question
2 The 60-second check
3 Where the numbers come from: procfs, sar and PSI
4–5 CPU: scheduler and saturation, profiling with perf and flame graphs
6–7 Memory: page cache and faults, pressure, swap and the OOM killer
8–9 File systems and disks
10 Benchmarking
11–12 Network: throughput and latency, saturation
13–14 Tracing with ftrace and perf, eBPF with bpftrace and bcc
15 Limiting resources and tuning
16 The final case

Every day follows the same pattern:

  • Where we start: what must be running, with a command that checks it.
  • Introduction: what today is about and why it matters, with the learning goals of the day.
  • Background: the concepts explained calmly – what happens in the kernel and which number means what. It begins with a picture for today, an everyday analogy that carries through the chapter: the course treats a server the way a family doctor treats patients – measure first, then judge. A table puts the new terms next to the picture.
  • Drills: step by step in your own lab. Before each drill it says which machine you work on and what you have afterwards. Every step first says what you do and why, then comes exactly one command – no loops, no long command chains, so that you understand and remember every command. Every command is explained with all its parameters, every file is shown in full, and after every step you see which output you can expect. All output comes from real runs. Measurements vary from machine to machine – the text tells you the order of magnitude your numbers should have and what matters.
  • Remember: at the end of each drill one sentence sums up the core – what you should still know in a week.
  • If it doesn’t work: the most common errors with message and fix.
  • Diagnosis task: a fault is built in, you only know the symptom. With the tools of the day you find the cause – the solution path comes after it.
  • Challenge: a harder task for those who want more.
  • Checkpoint: single commands that show whether everything is in place.
  • Test yourself: a few questions with answers to check whether you have understood the day.
  • Interview and Enterprise Note: what matters in a job interview and in operations.
  • Summary and Commands at a glance: what you have learned and every command of the day with its parameters for review.

At the end there are a cheat sheet with the 60-second check, a USE checklist for Linux and the most important bpftrace one-liners (Appendix A), an error catalog from symptom to cause (Appendix B) and an overview of all tools and packages with their cost in operation (Appendix C).

The lab

You work on two VMs with Ubuntu 24.04:

VM Role Size
perf1 the target: this is where you measure, this is where the faults are 4 vCPU, 8 GB RAM, 30 GB system disk + 20 GB extra disk
last1 generates load and is the remote end on the network 2 vCPU, 4 GB RAM, 30 GB disk

Both need internet access and must be able to reach each other. Which hypervisor runs underneath does not matter – Proxmox, KVM with libvirt, VMware, VirtualBox or Hyper-V. Day 0 shows what you need to check inside the VM so that all tools work, and what a VM fundamentally cannot do.

The versions this course was built and tested with (as of 2026-11-30): Ubuntu 24.04.5 with kernel 6.8.0, perf 6.8.12, sysstat 12.6.1, bcc 0.29.1, bpftrace 0.20.2, fio 3.36, stress-ng 0.17.06, iperf3 3.16, wrk 4.1.0, trace-cmd 3.2. Further versions are named in the chapter where the tool is added.

What you need

  • two VMs as above on which you can log in as a user with sudo rights,
  • a computer with an SSH client (Linux, macOS or Windows with OpenSSH),
  • about 40 hours of time, spread over as many days as you like.

A word about the source

The methodology of this course – the USE method, workload characterization, latency analysis, the warning against anti-methods – follows the standard work Systems Performance by Brendan Gregg. If you want to go deeper after this course, it is the best reading. The tools bcc, bpftrace and FlameGraph that you use here also partly come from him and are under free licenses. The text, examples, failure cases and graphics of this course are original work.

Good luck – and have fun measuring.

Thomas Zachmann

Contents

More