~mepsql-committers/mepsql/mepsql-5.1

Viewing all changes in revision 3615.

  • Committer: Mark Callaghan
  • Date: 2010-12-27 21:47:15 UTC
  • Revision ID: mdcallag@gmail.com-20101227214715-0lik4hpmgoxuxqzw
Implement innodb_fast_free_list option to make free-list management faster

This adds the dynamic my.cnf parameter innodb_fast_free_list that provides
an alternative to buf_flush_free_margin to flush dirty pages near the end of the
LRU. This is done as they will soon be moved to the free list but only clean pages
can be moved. The combination of buf_flush_free_margin and buf_flush_batch makes
one pass of the tail of the LRU to count dirty pages and then one pass from the tail
per page flushed. The buffer pool mutex is held during each pass and that mutex
already has a lot of contention. For workloads that frequently move pages from the
LRU to the free list (buffer pool pressure) this function is a bottleneck. The
alternative uses one pass of the tail to both count the dirty pages and save
the space & page ID values for them. The buffer pool mutex is held for that pass.
Then it iterates on the array and flushes one page at a time via
buf_flush_try_neighbors with the 'flush-neighbors' flag set to the value of the
dynamic my.cnf parameter innodb_flush_neighbors_for_lru.

The analysis above about the number of passes is the worst-case when
innodb_flush_neighbors_for_lru is OFF or when there are few dirty pages per
extent. Otherwise, mutiple dirty pages can be flushed per pass.

More performance tests will be run but this is disabled by default and should
be safe to add.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: