Commit 2ba97021 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-32050: Boost innodb_purge_batch_size on slow shutdown

A slow shutdown using the previous default innodb_purge_batch_size=300
could be extremely slow, employing at most a few CPU cores on the average.
Let us use the maximum batch size in order to increase throughput.

Reviewed by: Vladislav Lesin
parent aa719b50
......@@ -18854,7 +18854,7 @@ static MYSQL_SYSVAR_ULONG(purge_batch_size, srv_purge_batch_size,
NULL, NULL,
1000, /* Default setting */
1, /* Minimum value */
5000, 0); /* Maximum value */
innodb_purge_batch_size_MAX, 0);
static MYSQL_SYSVAR_UINT(purge_threads, srv_n_purge_threads,
PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
......
......@@ -47,6 +47,7 @@ static const ulint TRX_SYS_SPACE = 0;
static const ulint TRX_MAGIC_N = 91118598;
constexpr uint innodb_purge_threads_MAX= 32;
constexpr uint innodb_purge_batch_size_MAX= 5000;
/** Transaction states (trx_t::state) */
enum trx_state_t {
......
......@@ -1779,7 +1779,10 @@ void srv_purge_shutdown()
if (purge_sys.enabled())
{
if (!srv_fast_shutdown && !opt_bootstrap)
{
srv_purge_batch_size= innodb_purge_batch_size_MAX;
srv_update_purge_thread_count(innodb_purge_threads_MAX);
}
size_t history_size= trx_sys.history_size();
while (!srv_purge_should_exit(history_size))
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment