mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-14984 - regression in connect performance
Removed redundant plugin_thdvar_cleanup() from end_connection(): called by THD::free_connection(), which always follows end_connection(). Saves at least one lock(LOCK_plugin) and one rdlock(LOCK_system_variables_hash). Benchmarked on a 2socket/20core/40threads Broadwell system using sysbench connect brencmark @40 threads (with select 1 disabled). 10.2 shows moderate improvement: 136219.93 -> 137766.31 CPS. 10.3 is improvement is somewhat better: 93018.29 -> 101379.77 CPS. Also backported MyRocks memory leak fix from 10.4, which turned out to be unrelated.
This commit is contained in:
@ -98,8 +98,6 @@ void mysql_audit_release(THD *thd);
|
|||||||
bool thd_is_connection_alive(THD *thd);
|
bool thd_is_connection_alive(THD *thd);
|
||||||
/* Close connection with possible error code */
|
/* Close connection with possible error code */
|
||||||
void close_connection(THD *thd, uint errcode);
|
void close_connection(THD *thd, uint errcode);
|
||||||
/* End the connection before closing it */
|
|
||||||
void end_connection(THD *thd);
|
|
||||||
/* Decrement connection counter */
|
/* Decrement connection counter */
|
||||||
void dec_connection_count();
|
void dec_connection_count();
|
||||||
/* Destroy THD object */
|
/* Destroy THD object */
|
||||||
|
@ -1122,7 +1122,6 @@ void end_connection(THD *thd)
|
|||||||
}
|
}
|
||||||
thd->wsrep_client_thread= 0;
|
thd->wsrep_client_thread= 0;
|
||||||
#endif
|
#endif
|
||||||
plugin_thdvar_cleanup(thd);
|
|
||||||
|
|
||||||
if (thd->user_connect)
|
if (thd->user_connect)
|
||||||
{
|
{
|
||||||
|
@ -14010,6 +14010,8 @@ rocksdb_set_update_cf_options(THD *const /* unused */,
|
|||||||
|
|
||||||
RDB_MUTEX_LOCK_CHECK(rdb_sysvars_mutex);
|
RDB_MUTEX_LOCK_CHECK(rdb_sysvars_mutex);
|
||||||
|
|
||||||
|
my_free(*reinterpret_cast<void **>(var_ptr));
|
||||||
|
|
||||||
if (!val) {
|
if (!val) {
|
||||||
*reinterpret_cast<char **>(var_ptr) = nullptr;
|
*reinterpret_cast<char **>(var_ptr) = nullptr;
|
||||||
RDB_MUTEX_UNLOCK_CHECK(rdb_sysvars_mutex);
|
RDB_MUTEX_UNLOCK_CHECK(rdb_sysvars_mutex);
|
||||||
|
Reference in New Issue
Block a user