<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="innodb-performance-multiple_io_threads">
      </a>
      17.8.5 Configuring the Number of Background InnoDB I/O Threads
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045162734656">
  </a>
  <a class="indexterm" name="idm46045162733584">
  </a>
  <a class="indexterm" name="idm46045162732512">
  </a>
  <a class="indexterm" name="idm46045162731024">
  </a>
  <p>
   <code class="literal">
    InnoDB
   </code>
   uses background
   <a class="link" href="glossary.html#glos_thread" title="thread">
    threads
   </a>
   to service various
      types of I/O requests. You can configure the number of background
      threads that service read and write I/O on data pages using the
   <a class="link" href="innodb-parameters.html#sysvar_innodb_read_io_threads">
    <code class="literal">
     innodb_read_io_threads
    </code>
   </a>
   and
   <a class="link" href="innodb-parameters.html#sysvar_innodb_write_io_threads">
    <code class="literal">
     innodb_write_io_threads
    </code>
   </a>
   configuration parameters. These parameters signify the number of
      background threads used for read and write requests, respectively.
      They are effective on all supported platforms. You can set values
      for these parameters in the MySQL option file
      (
   <code class="literal">
    my.cnf
   </code>
   or
   <code class="literal">
    my.ini
   </code>
   ); you
      cannot change values dynamically. The default value for
   <a class="link" href="innodb-parameters.html#sysvar_innodb_read_io_threads">
    <code class="literal">
     innodb_read_io_threads
    </code>
   </a>
   is the
      number of available logical processors on the system divided by 2,
      with a minimum default value of
   <code class="literal">
    4
   </code>
   . The default
      value for
   <a class="link" href="innodb-parameters.html#sysvar_innodb_write_io_threads">
    <code class="literal">
     innodb_write_io_threads
    </code>
   </a>
   is 4. The permissible values range from
   <code class="literal">
    1-64
   </code>
   for both options.
  </p>
  <p>
   The purpose of these configuration options to make
   <code class="literal">
    InnoDB
   </code>
   more scalable on high end systems. Each
      background thread can handle up to 256 pending I/O requests. A
      major source of background I/O is
   <a class="link" href="glossary.html#glos_read_ahead" title="read-ahead">
    read-ahead
   </a>
   requests.
   <code class="literal">
    InnoDB
   </code>
   tries to balance the load of incoming
      requests in such way that most background threads share work
      equally.
   <code class="literal">
    InnoDB
   </code>
   also attempts to allocate read
      requests from the same extent to the same thread, to increase the
      chances of coalescing the requests. If you have a high end I/O
      subsystem and you see more than 64 ×
   <a class="link" href="innodb-parameters.html#sysvar_innodb_read_io_threads">
    <code class="literal">
     innodb_read_io_threads
    </code>
   </a>
   pending
      read requests in
   <code class="literal">
    SHOW ENGINE INNODB STATUS
   </code>
   output, you might improve performance by increasing the value of
   <a class="link" href="innodb-parameters.html#sysvar_innodb_read_io_threads">
    <code class="literal">
     innodb_read_io_threads
    </code>
   </a>
   .
  </p>
  <p>
   On Linux systems,
   <code class="literal">
    InnoDB
   </code>
   uses the asynchronous
      I/O subsystem by default to perform read-ahead and write requests
      for data file pages, which changes the way that
   <code class="literal">
    InnoDB
   </code>
   background threads service these types
      of I/O requests. For more information, see
   <a class="xref" href="innodb-linux-native-aio.html" title="17.8.6 Using Asynchronous I/O on Linux">
    Section 17.8.6, “Using Asynchronous I/O on Linux”
   </a>
   .
  </p>
  <p>
   For more information about
   <code class="literal">
    InnoDB
   </code>
   I/O
      performance, see
   <a class="xref" href="optimizing-innodb-diskio.html" title="10.5.8 Optimizing InnoDB Disk I/O">
    Section 10.5.8, “Optimizing InnoDB Disk I/O”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
