lp:~laurynas-biveinis/percona-server/xtradb-cleaner-tuning-5.6

Created by Laurynas Biveinis and last modified
Get this branch:
bzr branch lp:~laurynas-biveinis/percona-server/xtradb-cleaner-tuning-5.6
Only Laurynas Biveinis can upload to this branch. If you are Laurynas Biveinis please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Recent revisions

436. By Laurynas Biveinis on 2013-09-30

Tune page cleaner thread, implementing
https://blueprints.launchpad.net/percona-server/+spec/cleaner-tuning-5.6.

Create new type, local tu buf0flu.cc, struct flush_counters_t, that
has separate flushed and evicted page counters. Adjust
buf_flush_LRU_list(), buf_do_LRU_batch(), buf_flush_batch(), and
buf_flush_LRU() to return it.

In buf_flush_LRU_list(), add new arg limited_scan that optionally
limits the total number of scanned pages to srv_LRU_scan_depth, limit
scans to not go deeper than srv_LRU_scan_depth in the LRU list.

In buf_flush_common(), only call buf_dblwr_flush_buffered_writes() if
there have been flushed pages, fixing
http://bugs.mysql.com/bug.php?id=69170 / bug 1231918 ("buf_flush_LRU
is lazy" | buf_flush_common() calls buf_dblwr_flush_buffered_writes()
even when no pages flushed).

Rewrite buf_flush_list() to divide flush requests into chunks that are
issued to buffer pool instances in parallel and limit total running
time to a new UNIV_PERF_DEBUG-only variable
innodb_cleaner_max_flush_time, default 1000 miliseconds. The chunk
size is specified by a new UNIV_PERF_DEBUG-only variable
innodb_cleaner_flush_chunk_size, default 100.

Rewrite buf_flush_LRU_tail() to add timeouts as in buf_flush_list,
governed by a new UNIV_PERF_DEBUG-only variable
innodb_cleaner_max_lru_time. Likewise issue chunk batches to buffer
pool instances in parallel, with the exception of buffer pool
instances with almost-empty free lists (as defined by
UNIV_PERF_DEBUG-only innodb_cleaner_free_list_lwm, default 10%), for
which batches are issued sequentially. Make the chunk size tunable by
a new UNIV_PERF_DEBUG-only variable innodb_cleaner_lru_chunk_size,
default 100.

The timeouts in buf_flush_list() and buf_flush_LRU_tail() fix
http://bugs.mysql.com/bug.php?id=70453 / bug 1232101 (Add hard
timeouts to page cleaner flushes).

Add new functions buf_get_total_free_list_length(),
buf_cleaner_adapt_lru_sleep_time(), and
page_cleaner_adapt_flush_sleep_time(). They implement adaptive sleep
time reduction that may reduce page cleaner iteration time below 1
second and thus implement furious flushing, fixing
http://bugs.mysql.com/bug.php?id=68481 / bug 1232406 (Implement
furious flushing for 5.6).

The adaptiveness is implemented as follows. Maintain a desired target
sleep time for LRU flushes. If the total length of all buffer pool
instances is <1%, no sleep; if <5%, sleep 50 ms less, if between 5%
and 20%, no change; if >20%, sleep 50ms longer. Then, if the
checkpoint age is in preflush sync zone, set the sleep time to zero.

Add a new UNIV_PERF_DEBUG-only variable
innodb_cleaner_eviction_factor, default FALSE, that, if enabled, makes
LRU tail flushing to use evicted instead of flushed page counts for
its heuristics.

Add sys_vars tests for these variables.

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
lp:percona-server/5.6
This branch contains Public information 
Everyone can see this information.