Skip to content
StackDecode
System Design
16. Performance EngineeringAnimated

CPU Profiling

Finding where CPU time goes.

The idea

Profilers sample the call stack to show hot functions.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

AppsCollectorMetrics (Promet…Logs (Loki)Traces (Tempo)Dashboards
  • client
  • gateway / proxy
  • service
  • cache
  • data store
  • queue / stream

Apps emit metrics, logs and traces.

step:
1/4
at:
Apps
1/9

The green dot is a request moving through the system.

Step by step

  1. 1Run the profiler under load
  2. 2Collect stack samples
  3. 3Read a flame graph
  4. 4Optimise the widest bars

Where it is used

Slow code.

Watch out for

Profile in production-like conditions.

Related