#34359·yugabyte-db

[DocDB] Poor mutex behavior on rocksdb cache mutex

Author: es1024Created Sep 29, 2026Updated Sep 29, 2026
Labelskind/enhancementarea/docdbpriority/mediumstatus/awaiting-triage

Jira Link: DB-23901

Description

Context: #34118 Related: #34360

On nodes with very high core count, it has been observed that a very large portion of CPU time is spent inside the __GI___lll_wait and __GI___lll_wake functions that underpin pthread mutexes.

Under high contention with short critical sections, pthread mutexes can perform poorly due to the lack of a designated waker. Blocked threads are woken up one by one faster than they can get scheduled and run, causing the mutex to effectively degrade into a spinlock. This shows up on flamegraphs as very large amounts of time spent in _raw_spin_lock.

One mutex where this is an issue is the rocksdb block cache mutex, especially with low tablet count such as master (single tablet).

Issue Type

kind/enhancement

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.