Linux system performance hands-on
You find bottlenecks in CPU, memory, file systems, disks and network by measuring instead of guessing, back every cause with a number and finally solve a case with three hidden causes up to the report.
- Free · no subscription
- 17 days · 105–105 min each
- 86 drills · with expected output
# on perf1, terminal 2
$ uptime
Expected
12:13:36 up 2 days, 2:47, 1 user, load average: 4.00, 1.19, 0.45
As a book
The whole course to take with you, for reading away from the screen. Reading online stays free.
What you'll be able to do
- Narrow down a performance question with a problem statement, the USE method and the 60-second check instead of guessing
- Measure CPU, memory, file systems, disks and network with sysstat, PSI, perf and flame graphs and read the output correctly
- Ask the kernel your own questions with ftrace, bcc and bpftrace – histograms, system calls, block latency
- Limit and weight services with cgroups v2, measure tuning honestly and solve a case with several causes up to the report
What you need
LabTwo VMs with Ubuntu 24.04, SSH access and sudo on a shared network – a target with 4 vCPU/8 GB and an extra 20 GB disk, a load generator with 2 vCPU
BackgroundLinux in the terminal and as an admin, reading Python and C
InternetInternet access from the VMs for the packages on Day 0, after that everything runs locally
Prior knowledgeThe course is self-contained: lab, tools and every failure case are built in the course. It is for Linux admins, SREs and platform engineers who no longer want to answer slow servers with “more hardware”.
Set up your labKubernetes locally · Lab VMs
Training plan
One day = one sitting. Every day ends with a checkpoint and a challenge. About 2 hours in total.
Read first: Introduction
Training days
- Day 0 The lab grounds – two VMs, the tools and a first baselineset up access to two VMs, install all measurement tools of the course, prepare an extra disk, check what the VM can do and record first reference values 105 min
- Day 1 Methodology – how to ask a performance questionreliably tell apart the basic terms latency, throughput, utilization, saturation and errors, measure them in your own lab and know methods that lead to the goal – and those that only look like it
- Day 2 The 60-second checkassess an unknown Linux server with ten commands in a fixed order, interpret every important column and find a built-in bottleneck
- Day 3 Where the numbers come from – procfs, sar and PSIunderstand where vmstat, iostat and co. get their numbers from, read the raw counters yourself, look into the past with the sar recording and interpret PSI correctly – and clear up a misinterpreted load average
- Day 4 CPU I – scheduler and saturationunderstand how Linux distributes the CPU, measure waiting time in the run queue, interpret context switches and priorities, recognize CPU steal – and see why more threads are rarely faster
- Day 5 CPU II – profiling with perf and flame graphsuse perf to find out *where* a program spends its CPU time, make call chains fully visible, create and read flame graphs, interpret hardware counters and examine the time in which a program is *not* computing
- Day 6 Memory I – virtual memory, page cache and page faultsunderstand how Linux manages main memory, read free and /proc/meminfo correctly, measure the page cache, tell virtual from real memory, interpret RSS, PSS and USS, count page faults and find a process with growing memory
- Day 7 Memory II – pressure, swap, OOM killer and leaksrecognize when memory is really short, measure swap and reclaim, set memory limits for services, understand and prove the OOM killer, trace a memory leak down to the line of code and resolve a swap storm
- Day 8 File systems – cache, write-back, fsync and latency per operationunderstand the layer between program and disk, measure the hit rate of the page cache, observe delayed write-back, see file system latency per operation and find an application that slows itself down with fsync
- Day 9 Disks – block layer, iostat in depth and the process in state Dknow the path of a request through the block layer, interpret iostat -x confidently, understand the %util trap, measure disk latency per device and per request and trace a hanging process down to the slow device
- Day 10 Benchmarking – measuring honestlybuild benchmarks that measure what they are supposed to measure, recognize the typical mistakes, describe load profiles as a fio job file, report the spread and actively check every benchmark while it runs
- Day 11 Network I – throughput, latency and lost packetsknow the network stack roughly, read the counters for throughput and errors, look at a single TCP connection from the inside, understand why latency limits throughput, and prove packet loss on the path
- Day 12 Network II – saturation: interrupts, queues and conntracksee where a server with many connections hits its limits first – the CPU for network work, the queue for new connections or the kernel's connection table – and prove each of these limits
- Day 13 Tracing with ftrace and perfmake individual events in the kernel and in programs visible – process starts, function calls, system calls –, count them instead of only logging them, and know how much each tool slows down the measured system
- Day 14 eBPF with bpftrace and bccask the kernel your own questions – with bpftrace one-liners, histograms and small scripts –, understand what runs in the kernel while you do and what it costs, and follow a latency spike from the application down to the disk
- Day 15 Limiting and tuning resourceslimit and weight services with cgroups v2, measure and recognize the effects of a limit, and change a kernel setting so that the effect is measured and the change is documented
- Day 16 The final caseinvestigate a slow service with several hidden causes methodically, prove each cause with a measurement and fix it, measure again after every change and record the result in a short report
Ready? Day 0 takes 105 min.
Reading works without an account. A free account saves your progress.