We see much higher normal scheduler wall utilization on Ubuntu 26 than Ubuntu 22, using the same container image, dataset, and test scenario.
Environment:
OTP 27 / ERTS 15.2.7.12
Kernels: *Ubuntu 22: bu5.15.0-198-generic vs Ubuntu 26: 7.0.0-38-generic
Same CPU model, 64 logical CPUs, 64 online schedulers, unbound
No container CPU quota
The trigger is the first message to an existing 10,000-member channel after restarting our ejabberd-based service.
Representative approximately two-second peak windows:
Metric
Ubuntu 22
Ubuntu 26, two nodes
Normal scheduler wall utilization
7.0%
26.3–31.9%
Normal thread CPU utilization / 64 CPUs
7.9%
11.2–12.8%
Cumulative ETS-lock off-CPU time
0 s
17.7–22.7 s
We take two sorted snapshots of erlang:statistics(scheduler_wall_time_all), approximately two seconds apart, and calculate utilization for the normal scheduler IDs:
normal utilization = sum(delta ActiveTime) / sum(delta TotalTime)
we do have many ETS write oprations during the test, but the amount is same between ubuntu22 and ubuntu26.
Individual waits reach approximately 12–14 ms. Most waiting occurs before wakeup, rather than between wakeup and resumption. Hosts have substantial idle CPU capacity and no CPU throttling.
Thus, the observed difference is prolonged ETS lock blocking on Ubuntu 26, rather than a proportional increase in CPU execution. This identifies the waiting location, but does not establish why it differs between kernels.
NO_DELAY_DEQUEUE, NO_PLACE_LAG, and NO_WAKEUP_PREEMPTION did not help.
Caveats: off-CPU collection only includes waits ≥1 ms; the runs are separate and CPU work is not exactly equal. ETS call tracing was off during the target windows. We have not identified the lock holder.
Questions
Could Linux scheduling/preemption changes amplify this contention by changing contender timing or descheduling lock holders?
What would be the best next measurement to establish the cause while keeping 64 online schedulers unchanged?
id chase the holder next. a perf lock contention run in that same window gives you the holder side of those rwmutex waits, which is the half missing here.
Is there a good reason why you haven’t bound your schedulers? If ejabberd is doing most of the work on your server in the main schedulers, you really don’t want your kernel moving schedulers across cpus and trying to compact down to less cpus active. If you’re running other things on the same host, or you have a lot of work that happens in other schedulers etc, then ok.
I’m not super familiar with Linux scheduling, but 5.15 to 7.0 seems like several years of changes, so significant differences in scheduling seem likely.
My hunch is the new kernel is more likely to compact load onto fewer cpus, which tends to be good for energy efficiency, but means more latency for cross-scheduler communication as some schedulers will be waiting to run on one of the cpus the kernel has active. This would show up in top on the new kernel as beam schedulers more or less evenly busy, but if you show cpu% by core, many cores are idle and some cores are very busy. On the old kernel, beam schedulers would still be evenly busy, but so would cpu% by core
If that’s the case, I think you want to bind the schedulers, but you could also experiment with kernel tuning to try to get threads to spread out if binding isn’t reasonable. You may also want to test with BEAM load compaction on and off.
Thanks, that makes sense. Just to clarify, the attribution to ETS locks is inferred from the test scenario rather than confirmed by direct lock tracing.
These are ERTS user-space ethr_rwmutex locks. My understanding is that perf lock contention tracks kernel locks. Can it identify the holders of these ERTS locks directly?
Thanks, that’s a useful suggestion. We used the same unbound scheduler configuration on both kernels for this comparison. I’ll test scheduler binding and BEAM load compaction separately.
Also provide an update, I test several versions, seems the scheduler is good on linux 6.16, while bad on linux6.18, although there is some run-to-run variability in the test results.
MIght be related: in our case upgrade from kernel 6.17 to 7.00 caused massive performance problems. We found out the main reason was new default for transparent huge pages (THP). Setting kernel parameter