- Each read-write transaction uses a rollback segment to store undo-records (needed for rollback).
- Currently, InnoDB has 128 rollback segments (max) and they are shared by all the threads.
- This means if a user is running 1024 threads workload, 8 threads will use the same rollback segment. Given each thread is running a transaction at a given point in time.
- Put this on numa scale and the factor gets multiplied by numa scalability bottleneck that means the same rseg needs to be accessed by multiple threads located (possibly) across numa.
- All this makes rseg-mutex one of the hottest mutex.
Testing carried out using sysbench-update-index with 1024 threads on a machine with 4 numa (2 sockets). 10.6 branch #80ac9ec1).
EVENT_NAME |
WAIT_MS |
COUNT_STAR |
wait/synch/mutex/innodb/redo_rseg_mutex |
102697560.5683 |
58758773 |
wait/synch/mutex/innodb/log_sys_mutex |
49862366.5623 |
73277659 |
wait/synch/mutex/innodb/dict_sys_mutex |
21348825.2544 |
71961431 |
wait/synch/mutex/innodb/redo_rseg_mutex |
0.0905 |
2058 |
<70 secs of update-index workload with 1024 threads>
wait/synch/mutex/innodb/redo_rseg_mutex |
21298612.2935 |
17804286 |
<70 secs of update-index workload with 1024 threads>
wait/synch/mutex/innodb/redo_rseg_mutex |
61677736.5123 |
37997346 |
<70 secs of update-index workload with 1024 threads>
wait/synch/mutex/innodb/redo_rseg_mutex |
102884379.5462 |
58871725 |