Python script using 100 CPU
When one Python script pegs CPU, the first question is whether it is expected compute or accidental waste.
Common symptoms
- One script consistently pegs a core
- Machine becomes less responsive
- Runtime scales poorly with input size
Likely causes
- Busy loops
- Pathological algorithm complexity
- Heavy parsing or numerical work
Evidence to look for
Single script stays above 80% CPU
Runtime grows faster than input growth
Function-level samples cluster on a few code paths
What it usually means
Many Python CPU problems look like 'just needs more servers' but are really algorithmic or loop-structure issues.
What to do next
- 1Check for accidental busy loops
- 2Profile the hottest function
- 3Reduce repeated parsing and nested loops
See what's causing your CPU
cpum.ai turns CPU, process, disk, and memory signals into plain-English explanations with evidence.
Open cpum.ai