लॉक contention की वजह से CPU high
जब कई threads shared resources के लिए आपस में प्रतिस्पर्धा करती हैं, तो सिस्टम उपयोगी काम की बजाय coordination में CPU खर्च करता है।
Common symptoms
- CPU high, लेकिन throughput निराशाजनक
- ज्यादा concurrency से चीज़ें और बिगड़ती हैं
- Latency spikes अप्रत्याशित होती हैं
Likely causes
- Mutex या lock contention
- भारी load में shared data structures
- ऐसे critical sections जो बहुत व्यापक हैं
Evidence to look for
perf में spin या wait functions दिखते हैं
Context switches का latency से संबंध होता है
Threads कम करने से throughput बेहतर होता है
What it usually means
मशीन उपयोगी काम करने की बजाय locks के लिए प्रतिस्पर्धा में व्यस्त है।
What to do next
- 1Critical sections को संकुचित करें
- 2Shared-state access कम करें
- 3Hot paths के लिए lock-free data structures पर विचार करें
See what's causing your CPU
cpum.ai turns CPU, process, disk, and memory signals into plain-English explanations with evidence.
Open cpum.ai