June 19, 2013

Post: kernel_mutex problem. Or double throughput with single variable

… mutexes) has complex handling with spin loops, and there are two variables that affects mutex loops: innodb_sync_spin_loops and innodb_spin_wait_delay. I actually… with innodb_sync_spin_loops=100 we can improve to 145324 q/s , almost to peak throughput from first experiment. With innodb_sync_spin_loops=100…

Post: Internals of InnoDB mutexes

… simplification): spin_loop: for (i=0; i< innodb_spin_locks;i++) if (mutex_try_lock()) return; // success // we are here if spin loop was not…; innodb_spin_locks is configurable via system variable innodb_sync_spin_loops (default value is 20) There we have: 1. Spin-loop – InnoDB uses spin-loop in hopes…

Post: How Innodb Contention may manifest itself

…, however sometimes there is just too much spinning and it becomes inefficient. Reducing innodb_sync_spin_loops variable to smaller values is known to… increasing innodb_sync_spin_loops to a higher number. It is worth to note fine tuning Innodb Contention with number of spin locks loops is…

Post: SHOW INNODB STATUS walk through

… other important peice of information is number of “spin waits” and “spin rounds”. Spin locks are low cost wait, compared to OS wait… come to hundreds of thousands spin rounds per second to start really worry for most CPUs. innodb_sync_spin_loops can be used to ballance between wasting CPU time running spin locks and doing unneeded context…

Comment: SHOW INNODB STATUS walk through

“…innodb_sync_spin_loops can be used to ballance between wasting CPU time running spin locks and doing unneeded context switches…” So if we have a very large amount of spin waits and spin rounds, will we increase innodb_sync_spin_loops or decrease it in order to reduce spin waits/rounds?

Comment: SHOW INNODB STATUS walk through

…innodb_sync_spin_loops can be used to ballance between wasting CPU time running spin locks and doing unneeded context switches….” So if I see very large amount of spin waits and spin rounds, will I increase or decrease the innodb_sync_spin_loops in order to reduce CPU…

Comment: kernel_mutex problem. Or double throughput with single variable

… it comes back to SPIN LOOP Simplifying, InnoDB mutex looks like: mutex_enter(): { spin_loop: from i:=1 to innodb_sync_spin_loops: try acquire mutex; i++; sleep(rand_time); if mutex is not granted: pthread_cond_wait() goto: spin_loop; } mutex_exit…

Comment: kernel_mutex problem. Or double throughput with single variable

Baron, I believe I know the reason why innodb_sync_spin_loops helps there. The problem is old, and by some reason … again. Increasing innodb_sync_spin_loops allows to delay entering into using condition variables, and allows to resolve mutex only via spin_loop. In this…

Post: kernel_mutex problem cont. Or triple your throughput

… explanation why the performance degrades to significantly and why innodb_sync_spin_loops may fix it. Second, if that is correct ( or not… following: InnoDB still uses some strange mutex implementation, based on sync_arrays (hello 1990ies), I do not have a good reason….16 So innodb_thread_concurrency is even more helpful innodb_sync_spin_loops, and allows to get stable result even with 1024 threads…

Post: Ultimate MySQL variable and status reference list

….commanual innodb_strict_modeblogpercona.commanual innodb_support_xablogpercona.commanual innodb_sync_spin_loopsblogpercona.commanual innodb_table_locksblogpercona.commanual innodb_thread_concurrencyblogpercona.commanual…_engineblogpercona.commanual symbolic_linksblogpercona.commanual sync_binlogblogpercona.commanual sync_frmblogpercona.commanual sync_master_infoblogpercona.commanual sync_relay_logblogpercona.commanual sync_relay_log_infoblogpercona.commanual sysdate…