[MDEV-25029] Reduce dict_sys mutex contention for read-only workload Created: 2021-03-02  Updated: 2022-02-04  Resolved: 2021-03-05

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Fix Version/s: 10.6.0

Type: Task Priority: Major
Reporter: Krunal Bauskar Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: numa-scalability, performance

Issue Links:
Relates
relates to MDEV-27746 Wrong comparision of BLOB's empty pre... Closed

 Description   
  • Currently, during read-only workload with high contention (say 1024 threads)
    dict_sys mutex contention rises as a top-contention (as reported by performance schema).
  • read-only workload ideally shouldn't have anything to do with dict_sys mutex
    but optimizer needs stats and to read stat dict_sys mutex is taken.
  • dict_sys is global mutex even though optimizer may request stat for a said table only.
  • this contention is heavily visible when operating with higher scalability and especially
    with more numa nodes things get worse.
wait/synch/mutex/innodb/dict_sys_mutex 24670208.7616 50001391

<60 secs ro workload> ...

wait/synch/mutex/innodb/dict_sys_mutex 36223993.1059 95602955

-------------------------

How to solve it?

  • Probably check how dict_sys mutex could be relaxed for concurrent access.
  • Marko suggested a better solution. Starting 10.6 there is table->lock_mutex.
    Given table level mutex it could help reduce the contention.

--------------------------------------------

Very early POC has show improvement in sysbench-ro workload qps by 5-7%.
The approach also helps support the numa-scalability goal.



 Comments   
Comment by Krunal Bauskar [ 2021-03-03 ]

more recent number based on 10.6

baseline (10.6 #80ac9ec1): 820K
dict_sys (recently develop): 855K (4.26%)

So the said patch help improves 4-5%.

Generated at Thu Feb 08 09:34:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.