diff options
-rw-r--r-- | innobase/include/srv0srv.h | 1 | ||||
-rw-r--r-- | innobase/srv/srv0srv.c | 9 | ||||
-rw-r--r-- | mysql-test/r/innodb.result | 6 | ||||
-rw-r--r-- | mysql-test/t/innodb.test | 2 | ||||
-rw-r--r-- | sql/ha_innodb.cc | 4 | ||||
-rw-r--r-- | sql/mysqld.cc | 6 |
6 files changed, 15 insertions, 13 deletions
diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h index 23c9ef1e221..f379efa98eb 100644 --- a/innobase/include/srv0srv.h +++ b/innobase/include/srv0srv.h @@ -195,7 +195,6 @@ extern mutex_t* kernel_mutex_temp;/* mutex protecting the server, trx structs, #define kernel_mutex (*kernel_mutex_temp) #define SRV_MAX_N_IO_THREADS 100 -#define SRV_CONCURRENCY_THRESHOLD 20 /* Array of English strings describing the current state of an i/o handler thread */ diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 694345c4142..fe9e08d65be 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -258,9 +258,10 @@ threads waiting for locks are not counted into the number because otherwise we could get a deadlock. MySQL creates a thread for each user session, and semaphore contention and convoy problems can occur withput this restriction. Value 10 should be good if there are less than 4 processors + 4 disks in the -computer. Bigger computers need bigger values. */ +computer. Bigger computers need bigger values. Value 0 will disable the +concurrency check. */ -ulong srv_thread_concurrency = SRV_CONCURRENCY_THRESHOLD; +ulong srv_thread_concurrency = 0; ulong srv_commit_concurrency = 0; os_fast_mutex_t srv_conc_mutex; /* this mutex protects srv_conc data @@ -1141,7 +1142,7 @@ srv_conc_force_enter_innodb( trx_t* trx) /* in: transaction object associated with the thread */ { - if (srv_thread_concurrency >= SRV_CONCURRENCY_THRESHOLD) { + if (UNIV_LIKELY(!srv_thread_concurrency)) { return; } @@ -1167,7 +1168,7 @@ srv_conc_force_exit_innodb( { srv_conc_slot_t* slot = NULL; - if (srv_thread_concurrency >= SRV_CONCURRENCY_THRESHOLD) { + if (UNIV_LIKELY(!srv_thread_concurrency)) { return; } diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 973ad72042e..0816d0de43c 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1821,15 +1821,15 @@ Variable_name Value innodb_sync_spin_loops 20 show variables like "innodb_thread_concurrency"; Variable_name Value -innodb_thread_concurrency 20 -set global innodb_thread_concurrency=1000; +innodb_thread_concurrency 0 +set global innodb_thread_concurrency=1001; show variables like "innodb_thread_concurrency"; Variable_name Value innodb_thread_concurrency 1000 set global innodb_thread_concurrency=0; show variables like "innodb_thread_concurrency"; Variable_name Value -innodb_thread_concurrency 1 +innodb_thread_concurrency 0 set global innodb_thread_concurrency=16; show variables like "innodb_thread_concurrency"; Variable_name Value diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 7ae2b6d4ac2..8d2f18e2362 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1316,7 +1316,7 @@ show variables like "innodb_sync_spin_loops"; # Test for innodb_thread_concurrency variable show variables like "innodb_thread_concurrency"; -set global innodb_thread_concurrency=1000; +set global innodb_thread_concurrency=1001; show variables like "innodb_thread_concurrency"; set global innodb_thread_concurrency=0; show variables like "innodb_thread_concurrency"; diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index e66e79fde29..b33d2dfbd97 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -338,7 +338,7 @@ innodb_srv_conc_enter_innodb( /*=========================*/ trx_t* trx) /* in: transaction handle */ { - if (UNIV_LIKELY(srv_thread_concurrency >= SRV_CONCURRENCY_THRESHOLD)) { + if (UNIV_LIKELY(!srv_thread_concurrency)) { return; } @@ -355,7 +355,7 @@ innodb_srv_conc_exit_innodb( /*========================*/ trx_t* trx) /* in: transaction handle */ { - if (UNIV_LIKELY(srv_thread_concurrency >= SRV_CONCURRENCY_THRESHOLD)) { + if (UNIV_LIKELY(!srv_thread_concurrency)) { return; } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 08a47ca70f5..f738bb7cee1 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5504,9 +5504,11 @@ log and this option does nothing anymore.", (gptr*) &srv_n_spin_wait_rounds, 0, GET_LONG, REQUIRED_ARG, 20L, 0L, ~0L, 0, 1L, 0}, {"innodb_thread_concurrency", OPT_INNODB_THREAD_CONCURRENCY, - "Helps in performance tuning in heavily concurrent environments.", + "Helps in performance tuning in heavily concurrent environments. " + "Sets the maximum number of threads allowed inside InnoDB. Value 0" + " will disable the thread throttling.", (gptr*) &srv_thread_concurrency, (gptr*) &srv_thread_concurrency, - 0, GET_LONG, REQUIRED_ARG, 20, 1, 1000, 0, 1, 0}, + 0, GET_LONG, REQUIRED_ARG, 0, 0, 1000, 0, 1, 0}, {"innodb_commit_concurrency", OPT_INNODB_THREAD_CONCURRENCY, "Helps in performance tuning in heavily concurrent environments.", (gptr*) &srv_commit_concurrency, (gptr*) &srv_commit_concurrency, |