-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Performance
-
None
-
Workload Resilience
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Every operation creates an OperationCPUTimer, which reads CLOCK_THREAD_CPUTIME_ID when it starts and stops. That clock is not served by the vDSO, so each read is a real syscall: on a read-path microbenchmark these were 99% of all syscalls, and each cost about 1,500 TSC ticks (half in the kernel, half in user-mode stalls after returning), 3-6% of a point read.
The new parameter operationCPUTimingEnabled (default true, settable at startup and at runtime) skips creating the timer for new operations when false.
Measured effect
- YCSB workload B (95% read, 5% update) with operationCPUTimingEnabled=false: cycles/op -1.3%, instructions/op -1.9%
- YCSB workload C (100% read) with operationCPUTimingEnabled=false: cycles/op -1.9%, instructions/op -1.6%
YCSB, single-node replica set, 5M documents in the WiredTiger cache; cycles and instructions per operation.
Risk
Off only when set to false; then new operations report no cpuNanos (slow query log, profiler, $currentOp, query stats) and add no CPU time to execution control statistics. The default keeps today's behaviour.
Tests
Adds OperationCPUTimerTest.TimerNotSetIfDisabled.
- is related to
-
SERVER-90544 Investigate reducing cost of OperationCPUTimer
-
- Closed
-