← Back to team overview

maria-developers team mailing list archive

Re: MariaDB scalability: mutexes

 

Hi Axel,

it looks like locking profile of thr locks in read-write load is more complex.
Probably fast mutex behaves better in this scenario. OTOH table cache lock
durations do not depend on load type.

Could you benchmark it again with the following patches (attached):
1. unpatched
2. with thr lock patched
3. with table cache lock patched
4. with thr and table cache locks patched

...so we could pick best combination.

Thanks,
Sergey

On Mon, Mar 03, 2014 at 09:37:01AM +0100, Axel Schwenke wrote:
> Moin Svoj,
> 
> Sergey Vojtovich wrote:
> > Sergei pointed out that there is up to 10% slowdown in read-write benchmark at
> > high concurrency. Could you share benchmark details, I'd like to debug it.
> > Just pointers to build/run scripts on the benchmark server should be enough.
> 
> The benchmark was run on lizard2. Build script is ~/bin/xl_build_new
> 
> Benchmark runs under ~/benchmark/sysbench
> 
> series46 ... ro, single table, PFS=on, 32-128 threads
> series47 ... ro, single table, PFS=off, 32-128 threads
> series48 ... ro, multi table, PFS=on, 32-128 threads
> series49 ... ro, multi table, PFS=off, 32-128 threads
> series50 ... rw, multi table, PFS=off, 1-512 threads
> 
> 
> HTH,  XL
=== modified file 'sql/table_cache.cc'
--- sql/table_cache.cc	2014-03-28 07:30:10 +0000
+++ sql/table_cache.cc	2014-04-16 08:28:12 +0000
@@ -597,7 +597,7 @@ void tdc_init_share(TABLE_SHARE *share)
 {
   DBUG_ENTER("tdc_init_share");
   mysql_mutex_init(key_TABLE_SHARE_LOCK_table_share,
-                   &share->tdc.LOCK_table_share, MY_MUTEX_INIT_FAST);
+                   &share->tdc.LOCK_table_share, MY_MUTEX_INIT_SLOW);
   mysql_cond_init(key_TABLE_SHARE_COND_release, &share->tdc.COND_release, 0);
   share->tdc.m_flush_tickets.empty();
   share->tdc.all_tables.empty();

=== modified file 'mysys/thr_lock.c'
--- mysys/thr_lock.c	2012-09-27 18:09:46 +0000
+++ mysys/thr_lock.c	2014-04-16 08:28:34 +0000
@@ -424,7 +424,7 @@ void thr_lock_init(THR_LOCK *lock)
 {
   DBUG_ENTER("thr_lock_init");
   bzero((char*) lock,sizeof(*lock));
-  mysql_mutex_init(key_THR_LOCK_mutex, &lock->mutex, MY_MUTEX_INIT_FAST);
+  mysql_mutex_init(key_THR_LOCK_mutex, &lock->mutex, MY_MUTEX_INIT_SLOW);
   lock->read.last= &lock->read.data;
   lock->read_wait.last= &lock->read_wait.data;
   lock->write_wait.last= &lock->write_wait.data;


References