Finding bottlenecks is usually done as follows:
- Profiling CPU usage
- Profiling memory usage
- Profiling network usage
- Tracing
Profiling is observing code behavior or specific performance metrics within a single process or execution thread working on a single host, and is usually done by the process itself. Adding code to an application that allows it to log and measure different performance metrics is called instrumentation. Tracing is a generalization of profiling that allows you to observe and measure across many networked processes running on multiple hosts.
Profiling CPU usage is explained in the next section.