Comment 2 for bug 996545

Revision history for this message
Aurimas Mikalauskas (aurimas-mikalauskas) wrote :

For the record, I'm attaching email covering investigation on innodb_io_capacity that Laurynas was doing:

Aurimas, this is to answer your question, based on Percona Server 5.5:

  Only the master thread uses innodb_io_capacity in its background
  tasks. The master thread can be in one of the following loops
  depending on the server state and time:
  - Busy server loop that is executed once per one second.
  - Busy server loop that is executed once per ten seconds.
  - Idle server loop.

  Each of these loops does something that is I/O capacity related. I'm
  omitting other tasks that do I/O but do not use capacity (i.e. purge).
  The I/O-capacity-related tasks of the 1s busy loop:
  - If I/Os issued in the last 1s is less than 5% of capacity and
    currently outstanding I/Os are less than 3% of capacity, perform
    ibuf merge. The ibuf merges here and below also use
    innodb_io_capacity in determining how much work to do, I'm
    omitting this for simplicity because of ibuf_accel_rate.
  - If innodb_max_dirty_pages_pct is violated, flush io_capacity
    number of pages.
  - Otherwise, if adaptive flushing "estimate" method is used, flush
    at least io_capacity pages. ("at least" means I am omitting the
    details of flushing method adaptiveness here). Also note that
    this is the only adaptive flushing method that pays attention to
    I/O capacity at all.

  The tasks of the 10s busy loop:
  - If there were less than 200% of I/O capacity requests issued in
    the last 10s and currently outstanding I/O requests are less
    than 3% of capacity, flush io_capacity number of pages.
  - Unconditional ibuf merge.
  - If dirty pages in the buffer > 70%, flush io_capacity number of
    pages, otherwise io_capacity/10 pages.

  The tasks of the idle server loop. If there is server activity
  during any of these, the server goes back to the busy 1s loop.
  - Unconditional ibuf merge.
  - Unconditional flushing of io_capacity number of pages in a loop
    at least once or until innodb_max_dirty_pages_pct is not
    violated.