diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-08-03 19:08:11 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-08-03 19:08:11 +0300 |
commit | 859dbfea7716a83dd155392361006126b055568d (patch) | |
tree | 270410572a60be79d865d16209ae18be4c345254 /storage/innobase/include | |
parent | c12d24e29162f35f4fb751b761a0fbd84db19498 (diff) | |
download | mariadb-git-bb-10.5-MDEV-23379.tar.gz |
MDEV-23379 Deprecate&ignore InnoDB concurrency throttling parametersbb-10.5-MDEV-23379
The parameters innodb_thread_concurrency and innodb_commit_concurrency
were useful years ago when both computing resources and the implementation
of some shared data structures were limited, but nowadays enabling
any concurrency throttling for InnoDB actually makes things worse,
because queries have to wait outside InnoDB.
We have seen many customers mistakenly setting this to a small value
like 16 or 64 and then complaining the server was slow.
The parameters used to be useful a long time ago, when MySQL 5.0 or 5.1
had trouble scaling beyond 8 concurrent connections. Most
of the scalability bottlenecks have been removed since then, and
the transactions per second delivered by MariaDB Server 10.5 should
not dramatically drop upon exceeding the 'optimal' number of connections.
Ignoring the parameters allows us to remove some normally unused code
and data structures, which could slightly improve performance.
innodb_thread_concurrency, innodb_commit_concurrency,
innodb_replication_delay, innodb_concurrency_tickets,
innodb_thread_sleep_delay, innodb_adaptive_max_sleep_delay:
Deprecate and ignore; hard-wire to 0.
The column INFORMATION_SCHEMA.INNODB_TRX.trx_concurrency_tickets
will always report 0.
Diffstat (limited to 'storage/innobase/include')
-rw-r--r-- | storage/innobase/include/ha_prototypes.h | 5 | ||||
-rw-r--r-- | storage/innobase/include/que0types.h | 1 | ||||
-rw-r--r-- | storage/innobase/include/srv0conc.h | 93 | ||||
-rw-r--r-- | storage/innobase/include/srv0srv.h | 27 | ||||
-rw-r--r-- | storage/innobase/include/srv0start.h | 4 | ||||
-rw-r--r-- | storage/innobase/include/trx0i_s.h | 5 | ||||
-rw-r--r-- | storage/innobase/include/trx0trx.h | 15 |
7 files changed, 9 insertions, 141 deletions
diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h index ef1174c95dd..0632c0c5140 100644 --- a/storage/innobase/include/ha_prototypes.h +++ b/storage/innobase/include/ha_prototypes.h @@ -110,10 +110,7 @@ innobase_convert_name( /******************************************************************//** Returns true if the thread is the replication thread on the slave -server. Used in srv_conc_enter_innodb() to determine if the thread -should be allowed to enter InnoDB - the replication thread is treated -differently than other threads. Also used in -srv_conc_force_exit_innodb(). +server. @return true if thd is the replication thread */ ibool thd_is_replication_slave_thread( diff --git a/storage/innobase/include/que0types.h b/storage/innobase/include/que0types.h index d9005095d3c..38f6e380a30 100644 --- a/storage/innobase/include/que0types.h +++ b/storage/innobase/include/que0types.h @@ -35,6 +35,7 @@ typedef void que_node_t; /* Query graph root is a fork node */ typedef struct que_fork_t que_t; +struct row_prebuilt_t; struct que_thr_t; /* Query graph node types */ diff --git a/storage/innobase/include/srv0conc.h b/storage/innobase/include/srv0conc.h deleted file mode 100644 index d24107735ed..00000000000 --- a/storage/innobase/include/srv0conc.h +++ /dev/null @@ -1,93 +0,0 @@ -/***************************************************************************** - -Copyright (c) 2011, 2014, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2018, MariaDB Corporation. - -Portions of this file contain modifications contributed and copyrighted by -Google, Inc. Those modifications are gratefully acknowledged and are described -briefly in the InnoDB documentation. The contributions by Google are -incorporated with their permission, and subject to the conditions contained in -the file COPYING.Google. - -Portions of this file contain modifications contributed and copyrighted -by Percona Inc.. Those modifications are -gratefully acknowledged and are described briefly in the InnoDB -documentation. The contributions by Percona Inc. are incorporated with -their permission, and subject to the conditions contained in the file -COPYING.Percona. - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA - -*****************************************************************************/ - -/**************************************************//** -@file srv/srv0conc.h - -InnoDB concurrency manager header file - -Created 2011/04/18 Sunny Bains -*******************************************************/ - -#ifndef srv_conc_h -#define srv_conc_h - -/** We are prepared for a situation that we have this many threads waiting for -a semaphore inside InnoDB. srv_start() sets the value. */ -extern ulint srv_max_n_threads; - -/** The following controls how many threads we let inside InnoDB concurrently: -threads waiting for locks are not counted into the number because otherwise -we could get a deadlock. Value of 0 will disable the concurrency check. */ - -extern ulong srv_thread_concurrency; - -struct row_prebuilt_t; -/*********************************************************************//** -Puts an OS thread to wait if there are too many concurrent threads -(>= srv_thread_concurrency) inside InnoDB. The threads wait in a FIFO queue. -@param[in,out] prebuilt row prebuilt handler */ -void -srv_conc_enter_innodb( - row_prebuilt_t* prebuilt); - -/*********************************************************************//** -This lets a thread enter InnoDB regardless of the number of threads inside -InnoDB. This must be called when a thread ends a lock wait. */ -void -srv_conc_force_enter_innodb( -/*========================*/ - trx_t* trx); /*!< in: transaction object associated with - the thread */ - -/*********************************************************************//** -This must be called when a thread exits InnoDB in a lock wait or at the -end of an SQL statement. */ -void -srv_conc_force_exit_innodb( -/*=======================*/ - trx_t* trx); /*!< in: transaction object associated with - the thread */ - -/*********************************************************************//** -Get the count of threads waiting inside InnoDB. */ -ulint -srv_conc_get_waiting_threads(void); -/*==============================*/ - -/*********************************************************************//** -Get the count of threads active inside InnoDB. */ -ulint -srv_conc_get_active_threads(void); -/*==============================*/ - -#endif /* srv_conc_h */ diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 9cad1497b85..57542b32719 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -39,14 +39,12 @@ The server main program Created 10/10/1995 Heikki Tuuri *******************************************************/ -#ifndef srv0srv_h -#define srv0srv_h +#pragma once #include "log0log.h" #include "os0event.h" #include "que0types.h" #include "trx0types.h" -#include "srv0conc.h" #include "fil0fil.h" #include "mysql/psi/mysql_stage.h" @@ -198,6 +196,10 @@ struct srv_stats_t ulint_ctr_1_t lock_deadlock_count; }; +/** We are prepared for a situation that we have this many threads waiting for +a semaphore inside InnoDB. srv_start() sets the value. */ +extern ulint srv_max_n_threads; + extern const char* srv_main_thread_op_info; /** Prefix used by MySQL to indicate pre-5.1 table name encoding */ @@ -246,10 +248,6 @@ extern my_bool high_level_read_only; /** store to its own file each table created by an user; data dictionary tables are in the system tablespace 0 */ extern my_bool srv_file_per_table; -/** Sleep delay for threads waiting to enter InnoDB. In micro-seconds. */ -extern ulong srv_thread_sleep_delay; -/** Maximum sleep delay (in micro-seconds), value of 0 disables it.*/ -extern ulong srv_adaptive_max_sleep_delay; /** Sort buffer size in index creation */ extern ulong srv_sort_buf_size; @@ -423,8 +421,6 @@ extern double srv_max_buf_pool_modified_pct; extern ulong srv_max_purge_lag; extern ulong srv_max_purge_lag_delay; -extern ulong srv_replication_delay; - extern my_bool innodb_encrypt_temporary_tables; extern my_bool srv_immediate_scrub_data_uncompressed; @@ -455,8 +451,6 @@ extern bool srv_monitor_active; extern ulong srv_n_spin_wait_rounds; -extern ulong srv_n_free_tickets_to_enter; -extern ulong srv_thread_sleep_delay; extern uint srv_spin_wait_delay; extern ulint srv_truncated_status_writes; @@ -942,14 +936,3 @@ static inline void srv_start_periodic_timer(std::unique_ptr<tpool::timer>& t, void srv_thread_pool_init(); void srv_thread_pool_end(); - -#ifdef WITH_WSREP -UNIV_INTERN -void -wsrep_srv_conc_cancel_wait( -/*==================*/ - trx_t* trx); /*!< in: transaction object associated with the - thread */ -#endif /* WITH_WSREP */ - -#endif diff --git a/storage/innobase/include/srv0start.h b/storage/innobase/include/srv0start.h index 596f6d4f5ab..23dc8347129 100644 --- a/storage/innobase/include/srv0start.h +++ b/storage/innobase/include/srv0start.h @@ -24,8 +24,7 @@ Starts the Innobase database server Created 10/10/1995 Heikki Tuuri *******************************************************/ -#ifndef srv0start_h -#define srv0start_h +#pragma once #include "log0log.h" #include "ut0byte.h" @@ -133,4 +132,3 @@ extern enum srv_shutdown_t srv_shutdown_state; /** Files comprising the system tablespace */ extern pfs_os_file_t files[1000]; -#endif diff --git a/storage/innobase/include/trx0i_s.h b/storage/innobase/include/trx0i_s.h index 4eab97c0b02..892ee3cfe18 100644 --- a/storage/innobase/include/trx0i_s.h +++ b/storage/innobase/include/trx0i_s.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2019, MariaDB Corporation. +Copyright (c) 2017, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -141,9 +141,6 @@ struct i_s_trx_row_t { trx->lock_heap) */ ulint trx_rows_locked;/*!< lock_number_of_rows_locked() */ uintmax_t trx_rows_modified;/*!< trx_t::undo_no */ - ulint trx_concurrency_tickets; - /*!< n_tickets_to_enter_innodb in - trx_t */ uint trx_isolation_level; /*!< trx_t::isolation_level */ bool trx_unique_checks; diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index 034552fc62e..20043a6c4a4 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -864,17 +864,6 @@ public: ulint duplicates; /*!< TRX_DUP_IGNORE | TRX_DUP_REPLACE */ trx_dict_op_t dict_operation; /**< @see enum trx_dict_op_t */ - /* Fields protected by the srv_conc_mutex. */ - bool declared_to_be_inside_innodb; - /*!< this is TRUE if we have declared - this transaction in - srv_conc_enter_innodb to be inside the - InnoDB engine */ - ib_uint32_t n_tickets_to_enter_innodb; - /*!< this can be > 0 only when - declared_to_... is TRUE; when we come - to srv_conc_innodb_enter, if the value - here is > 0, we decrement this by 1 */ ib_uint32_t dict_operation_lock_mode; /*!< 0, RW_S_LATCH, or RW_X_LATCH: the latch mode trx currently holds @@ -1018,10 +1007,6 @@ public: /*!< Total table lock wait time up to this moment. */ -#ifdef WITH_WSREP - os_event_t wsrep_event; /* event waited for in srv_conc_slot */ -#endif /* WITH_WSREP */ - rw_trx_hash_element_t *rw_trx_hash_element; LF_PINS *rw_trx_hash_pins; ulint magic_n; |