Work out context switch rate instantly with clear inputs, formula shown and shareable results.
Each context switch costs a few microseconds in direct scheduling work plus indirect cache and TLB pollution that can be much larger. At 180,000 switches per second across 16 cores that is roughly 3 percent of CPU, which is tolerable — but the same rate on four cores would be 13 percent, and thread-per-request designs reach that easily under load.
Switching overhead
overhead share = switches per second x cost per switch / (cores x 1,000,000); per core = switches / cores
More runnable threads than cores, lock contention, frequent blocking I/O and short timer intervals. Thread pools sized far above core count are the usual culprit.
Involuntary switches mean the scheduler preempted a thread that still had work, which indicates CPU oversubscription. High voluntary switching usually points at blocking I/O or locks.