Interview Prep/Linux/Migrations, performance and fleet operations

You need to measure where an application spends CPU time in production without restarting it. How?

AdvancedScenarioMigrations, performance and fleet operations
Answer

Situation read → Sampling profiler with low overhead.

What I'd do →

sudo perf top -p <PID>
sudo perf record -F 99 -g -p <PID> -- sleep 30
sudo perf report --stdio | head -50

Generate a flame graph (perf script | stackcollapse-perf.pl | flamegraph.pl > out.svg). For runtimes: py-spy record -p PID, async-profiler for Java. eBPF tools: profile-bpfcc -F 99 30.

Why → Sampling at 99 Hz has negligible overhead and shows hot code paths.

Interview tip → Mention that missing symbols (no frame pointers / no debuginfo) make stacks unreadable.

All Linux questions Roadmap: Linux

More on Migrations, performance and fleet operations