A server is slow and `vmstat` shows a high `cs` (context switches) value, 500k per second.
AdvancedTroubleshootingLoad, CPU and I/O performance
Answer
Likely causes → Too many threads competing for CPUs, lock contention, or very chatty IPC/network patterns.
Diagnose →
vmstat 1 5
pidstat -w 1 5 # cswch/s (voluntary) and nvcswch/s (involuntary) per process
ps -eLf | wc -l # total threads
Fix → High involuntary switches: too many runnable threads; reduce thread pools to near core count. High voluntary: threads blocking on locks or I/O; investigate contention.
Prevent → Size thread pools deliberately; load test.
More on Load, CPU and I/O performance
Load average is 35 on an 8-core server, but `top` shows CPU 85% idle.Intermediate`top` shows `wa` at 60% and the application is crawling.Beginner`iostat` shows a disk at `%util 100` but throughput is only 5 MB/s.IntermediateCPU usage is moderate, but the app's latency doubled after moving to a larger VM with two NUMA nodes.AdvancedA server's CPU usage is 100% and `top` shows `kworker` or `ksoftirqd` at the top.AdvancedOne CPU core sits at 100% while the others are idle, and the app can't go faster.Intermediate