How do you profile why an application is slow but not using CPU?
AdvancedProductionPerformance & the USE Method
Answer
It is blocked off-CPU: on locks, disk, network or sleeps. Use off-CPU analysis:
sudo offcputime-bpfcc -p <pid> -f 30 > offcpu.stacks # folded stacks for flame graph
sudo strace -f -T -p <pid> -e trace=network,read,write # time per syscall
sudo tcplife-bpfcc # connection durations
Then correlate with downstream latency (database slow log, upstream timings, connection pool waits).
More on Performance & the USE Method
What is the USE method?BeginnerMap the USE method to concrete Linux commands.IntermediateWhat is your "first 60 seconds" checklist on a slow server?IntermediateHow do you read vmstat output?IntermediateHow do you read `iostat -xz 1`?IntermediateWhat is sar and why install sysstat on every server?Beginner