<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="innodb-init-startup-configuration">
      </a>
      17.8.1 InnoDB Startup Configuration
     </h3>
    </div>
   </div>
  </div>
  <p>
   The first decisions to make about
   <code class="literal">
    InnoDB
   </code>
   configuration involve the configuration of data files, log files,
      page size, and memory buffers, which should be configured before
      initializing
   <code class="literal">
    InnoDB
   </code>
   . Modifying the
      configuration after
   <code class="literal">
    InnoDB
   </code>
   is initialized may
      involve non-trivial procedures.
  </p>
  <p>
   This section provides information about specifying
   <code class="literal">
    InnoDB
   </code>
   settings in a configuration file,
      viewing
   <code class="literal">
    InnoDB
   </code>
   initialization information, and
      important storage considerations.
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="xref" href="innodb-init-startup-configuration.html#innodb-startup-mysql-configuration-file" title="Specifying Options in a MySQL Option File">
       Specifying Options in a MySQL Option File
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="innodb-init-startup-configuration.html#innodb-startup-initialization-information" title="Viewing InnoDB Initialization Information">
       Viewing InnoDB Initialization Information
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="innodb-init-startup-configuration.html#innodb-startup-storage-considerations" title="Important Storage Considerations">
       Important Storage Considerations
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="innodb-init-startup-configuration.html#innodb-startup-data-file-configuration" title="System Tablespace Data File Configuration">
       System Tablespace Data File Configuration
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="innodb-init-startup-configuration.html#innodb-startup-doublewrite-file-config" title="InnoDB Doublewrite Buffer File Configuration">
       InnoDB Doublewrite Buffer File Configuration
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="innodb-init-startup-configuration.html#innodb-startup-log-file-configuration" title="Redo Log Configuration">
       Redo Log Configuration
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="innodb-init-startup-configuration.html#innodb-startup-undo-tablespace" title="Undo Tablespace Configuration">
       Undo Tablespace Configuration
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="innodb-init-startup-configuration.html#innodb-startup-temporary-tablespace" title="Global Temporary Tablespace Configuration">
       Global Temporary Tablespace Configuration
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="innodb-init-startup-configuration.html#innodb-startup-session-temporary-tablespaces" title="Session Temporary Tablespace Configuration">
       Session Temporary Tablespace Configuration
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="innodb-init-startup-configuration.html#innodb-startup-page-size" title="Page Size Configuration">
       Page Size Configuration
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="innodb-init-startup-configuration.html#innodb-startup-memory-configuration" title="Memory Configuration">
       Memory Configuration
      </a>
     </p>
    </li>
   </ul>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="innodb-startup-mysql-configuration-file">
       </a>
       Specifying Options in a MySQL Option File
      </h4>
     </div>
    </div>
   </div>
   <p>
    Because MySQL uses data file, log file, and page size settings
        to initialize
    <code class="literal">
     InnoDB
    </code>
    , it is recommended that
        you define these settings in an option file that MySQL reads at
        startup, prior to initializing
    <code class="literal">
     InnoDB
    </code>
    .
        Normally,
    <code class="literal">
     InnoDB
    </code>
    is initialized when the
        MySQL server is started for the first time.
   </p>
   <p>
    You can place
    <code class="literal">
     InnoDB
    </code>
    options in the
    <code class="literal">
     [mysqld]
    </code>
    group of any option file that your
        server reads when it starts. The locations of MySQL option files
        are described in
    <a class="xref" href="option-files.html" title="6.2.2.2 Using Option Files">
     Section 6.2.2.2, “Using Option Files”
    </a>
    .
   </p>
   <p>
    To make sure that
    <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
     <span class="command">
      <strong>
       mysqld
      </strong>
     </span>
    </a>
    reads options only
        from a specific file (and
    <code class="filename">
     mysqld-auto.cnf
    </code>
    ),
        use the
    <a class="link" href="option-file-options.html#option_general_defaults-file">
     <code class="option">
      --defaults-file
     </code>
    </a>
    option
        as the first option on the command line when starting the
        server:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa36828397"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal">mysqld <span class="token constant">--defaults-file</span><span class="token attr-value"><span class="token punctuation">=</span><em class="replaceable">path_to_option_file</em></span></code></pre>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="innodb-startup-initialization-information">
       </a>
       Viewing InnoDB Initialization Information
      </h4>
     </div>
    </div>
   </div>
   <p>
    To view
    <code class="literal">
     InnoDB
    </code>
    initialization information
        during startup, start
    <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
     <span class="command">
      <strong>
       mysqld
      </strong>
     </span>
    </a>
    from a command
        prompt, which prints initialization information to the console.
   </p>
   <p>
    For example, on Windows, if
    <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
     <span class="command">
      <strong>
       mysqld
      </strong>
     </span>
    </a>
    is located
        in
    <code class="filename">
     C:\Program Files\MySQL\MySQL Server
        8.4\bin
    </code>
    , start the MySQL server like
        this:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa97512061"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">C:\&gt;</span> <span class="token atrule">"C:\Program Files\MySQL\MySQL Server 8.4\bin\mysqld"</span> <span class="token property">--console</span></code></pre>
   </div>
   <p>
    On Unix-like systems,
    <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
     <span class="command">
      <strong>
       mysqld
      </strong>
     </span>
    </a>
    is located in
        the
    <code class="filename">
     bin
    </code>
    directory of your MySQL
        installation:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa47297954"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">bin/mysqld</span> <span class="token constant">--user</span><span class="token attr-value"><span class="token punctuation">=</span>mysql</span> &amp;</code></pre>
   </div>
   <p>
    If you do not send server output to the console, check the error
        log after startup to see the initialization information
    <code class="literal">
     InnoDB
    </code>
    printed during the startup process.
   </p>
   <p>
    For information about starting MySQL using other methods, see
    <a class="xref" href="automatic-start.html" title="2.9.5 Starting and Stopping MySQL Automatically">
     Section 2.9.5, “Starting and Stopping MySQL Automatically”
    </a>
    .
   </p>
   <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Note
    </div>
    <p>
     <code class="literal">
      InnoDB
     </code>
     does not open all user tables and
          associated data files at startup. However,
     <code class="literal">
      InnoDB
     </code>
     does check for the existence of
          tablespace files referenced in the data dictionary. If a
          tablespace file is not found,
     <code class="literal">
      InnoDB
     </code>
     logs
          an error and continues the startup sequence. Tablespace files
          referenced in the redo log may be opened during crash recovery
          for redo application.
    </p>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="innodb-startup-storage-considerations">
       </a>
       Important Storage Considerations
      </h4>
     </div>
    </div>
   </div>
   <a class="indexterm" name="idm46045163616192">
   </a>
   <a class="indexterm" name="idm46045163614688">
   </a>
   <p>
    Review the following storage-related considerations before
        proceeding with your startup configuration.
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       In some cases, you can improve database performance by
            placing data and log files on separate physical disks. You
            can also use raw disk partitions (raw devices) for
       <code class="literal">
        InnoDB
       </code>
       data files, which may speed up
            I/O. See
       <a class="xref" href="innodb-system-tablespace.html#innodb-raw-devices" title="Using Raw Disk Partitions for the System Tablespace">
        Using Raw Disk Partitions for the System Tablespace
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        InnoDB
       </code>
       is a transaction-safe (ACID
            compliant) storage engine with commit, rollback, and
            crash-recovery capabilities to protect user data.
       <span class="bold">
        <strong>
         However, it cannot do so
        </strong>
       </span>
       if
            the underlying operating system or hardware does not work as
            advertised. Many operating systems or disk subsystems may
            delay or reorder write operations to improve performance. On
            some operating systems, the very
       <code class="literal">
        fsync()
       </code>
       system call that should wait until all unwritten data for a
            file has been flushed might actually return before the data
            has been flushed to stable storage. Because of this, an
            operating system crash or a power outage may destroy
            recently committed data, or in the worst case, even corrupt
            the database because write operations have been reordered.
            If data integrity is important to you, perform
       <span class="quote">
        “
        <span class="quote">
         pull-the-plug
        </span>
        ”
       </span>
       tests before using anything in
            production. On macOS,
       <code class="literal">
        InnoDB
       </code>
       uses a
            special
       <code class="literal">
        fcntl()
       </code>
       file flush method. Under
            Linux, it is advisable to
       <span class="bold">
        <strong>
         disable the
            write-back cache
        </strong>
       </span>
       .
      </p>
      <p>
       On ATA/SATA disk drives, a command such
       <code class="literal">
        hdparm -W0
            /dev/hda
       </code>
       may work to disable the write-back cache.
       <span class="bold">
        <strong>
         Beware that some drives or disk
            controllers may be unable to disable the write-back
            cache.
        </strong>
       </span>
      </p>
     </li>
     <li class="listitem">
      <p>
       With regard to
       <code class="literal">
        InnoDB
       </code>
       recovery
            capabilities that protect user data,
       <code class="literal">
        InnoDB
       </code>
       uses a file flush technique
            involving a structure called the
       <a class="link" href="glossary.html#glos_doublewrite_buffer" title="doublewrite buffer">
        doublewrite
            buffer
       </a>
       , which is enabled by default
            (
       <a class="link" href="innodb-parameters.html#sysvar_innodb_doublewrite">
        <code class="literal">
         innodb_doublewrite=ON
        </code>
       </a>
       ).
            The doublewrite buffer adds safety to recovery following an
            unexpected exit or power outage, and improves performance on
            most varieties of Unix by reducing the need for
       <code class="literal">
        fsync()
       </code>
       operations. It is recommended
            that the
       <a class="link" href="innodb-parameters.html#sysvar_innodb_doublewrite">
        <code class="literal">
         innodb_doublewrite
        </code>
       </a>
       option remains enabled if you are concerned with data
            integrity or possible failures. For information about the
            doublewrite buffer, see
       <a class="xref" href="innodb-disk-io.html" title="17.11.1 InnoDB Disk I/O">
        Section 17.11.1, “InnoDB Disk I/O”
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       Before using NFS with
       <code class="literal">
        InnoDB
       </code>
       , review
            potential issues outlined in
       <a class="xref" href="disk-issues.html#disk-issues-nfs" title="Using NFS with MySQL">
        Using NFS with MySQL
       </a>
       .
      </p>
     </li>
    </ul>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="innodb-startup-data-file-configuration">
       </a>
       System Tablespace Data File Configuration
      </h4>
     </div>
    </div>
   </div>
   <p>
    The
    <a class="link" href="innodb-parameters.html#sysvar_innodb_data_file_path">
     <code class="literal">
      innodb_data_file_path
     </code>
    </a>
    option defines the name, size, and attributes of
    <code class="literal">
     InnoDB
    </code>
    system tablespace data files. If you
        do not configure this option prior to initializing the MySQL
        server, the default behavior is to create a single
        auto-extending data file, slightly larger than 12MB, named
    <code class="filename">
     ibdata1
    </code>
    :
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa15342673"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SHOW</span> <span class="token keyword">VARIABLES</span> <span class="token operator">LIKE</span> <span class="token string">'innodb_data_file_path'</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Variable_name         <span class="token punctuation">|</span> Value                  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> innodb_data_file_path <span class="token punctuation">|</span> ibdata1:12M:autoextend <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
   </div>
   <p>
    The full data file specification syntax includes the file name,
        file size,
    <code class="literal">
     autoextend
    </code>
    attribute, and
    <code class="literal">
     max
    </code>
    attribute:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-ini"><div class="docs-select-all right" id="sa78484555"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-ini"><em class="replaceable">file_name</em>:<em class="replaceable">file_size</em>[:autoextend[:max:<em class="replaceable">max_file_size</em>]]</code></pre>
   </div>
   <p>
    File sizes are specified in kilobytes, megabytes, or gigabytes
        by appending
    <code class="literal">
     K
    </code>
    ,
    <code class="literal">
     M
    </code>
    or
    <code class="literal">
     G
    </code>
    to the size value. If specifying the data
        file size in kilobytes, do so in multiples of 1024. Otherwise,
        kilobyte values are rounded to nearest megabyte (MB) boundary.
        The sum of file sizes must be, at a minimum, slightly larger
        than 12MB.
   </p>
   <p>
    You can specify more than one data file using a
        semicolon-separated list. For example:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa50218135"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-ini"><span class="token selector">[mysqld]</span>
<span class="token constant">innodb_data_file_path</span><span class="token attr-value"><span class="token punctuation">=</span>ibdata1:50M;ibdata2:50M:autoextend</span></code></pre>
   </div>
   <p>
    The
    <code class="literal">
     autoextend
    </code>
    and
    <code class="literal">
     max
    </code>
    attributes can be used only for the data file that is specified
        last.
   </p>
   <p>
    When the
    <code class="literal">
     autoextend
    </code>
    attribute is specified,
        the data file automatically increases in size by 64MB increments
        as space is required. The
    <a class="link" href="innodb-parameters.html#sysvar_innodb_autoextend_increment">
     <code class="literal">
      innodb_autoextend_increment
     </code>
    </a>
    variable controls the increment size.
   </p>
   <p>
    To specify a maximum size for an auto-extending data file, use
        the
    <code class="literal">
     max
    </code>
    attribute following the
    <code class="literal">
     autoextend
    </code>
    attribute. Use the
    <code class="literal">
     max
    </code>
    attribute only in cases where
        constraining disk usage is of critical importance. The following
        configuration permits
    <code class="filename">
     ibdata1
    </code>
    to grow to a
        limit of 500MB:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa7590620"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-ini"><span class="token selector">[mysqld]</span>
<span class="token constant">innodb_data_file_path</span><span class="token attr-value"><span class="token punctuation">=</span>ibdata1:12M:autoextend:max:500M</span></code></pre>
   </div>
   <p>
    A minimum file size is enforced for the
    <span class="emphasis">
     <em>
      first
     </em>
    </span>
    system tablespace data file to ensure
        that there is enough space for doublewrite buffer pages. The
        following table shows minimum file sizes for each
    <code class="literal">
     InnoDB
    </code>
    page size. The default
    <code class="literal">
     InnoDB
    </code>
    page size is 16384 (16KB).
   </p>
   <div class="informaltable">
    <table summary="The minimum system tablespace data file for each InnoDB page size.">
     <colgroup>
      <col style="width: 30%"/>
      <col style="width: 30%"/>
     </colgroup>
     <thead>
      <tr>
       <th>
        Page Size (innodb_page_size)
       </th>
       <th>
        Minimum File Size
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <td>
        16384 (16KB) or less
       </td>
       <td>
        3MB
       </td>
      </tr>
      <tr>
       <td>
        32768 (32KB)
       </td>
       <td>
        6MB
       </td>
      </tr>
      <tr>
       <td>
        65536 (64KB)
       </td>
       <td>
        12MB
       </td>
      </tr>
     </tbody>
    </table>
   </div>
   <p>
    If your disk becomes full, you can add a data file on another
        disk. For instructions, see
    <a class="xref" href="innodb-system-tablespace.html#innodb-resize-system-tablespace" title="Resizing the System Tablespace">
     Resizing the System Tablespace
    </a>
    .
   </p>
   <p>
    The size limit for individual files is determined by your
        operating system. You can set the file size to more than 4GB on
        operating systems that support large files. You can also use raw
        disk partitions as data files. See
    <a class="xref" href="innodb-system-tablespace.html#innodb-raw-devices" title="Using Raw Disk Partitions for the System Tablespace">
     Using Raw Disk Partitions for the System Tablespace
    </a>
    .
   </p>
   <p>
    <code class="literal">
     InnoDB
    </code>
    is not aware of the file system
        maximum file size, so be cautious on file systems where the
        maximum file size is a small value such as 2GB.
   </p>
   <p>
    System tablespace files are created in the data directory by
        default (
    <a class="link" href="server-system-variables.html#sysvar_datadir">
     <code class="literal">
      datadir
     </code>
    </a>
    ). To specify
        an alternate location, use the
    <a class="link" href="innodb-parameters.html#sysvar_innodb_data_home_dir">
     <code class="literal">
      innodb_data_home_dir
     </code>
    </a>
    option.
        For example, to create a system tablespace data file in a
        directory named
    <code class="filename">
     myibdata
    </code>
    , use this
        configuration:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa63645759"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-ini"><span class="token selector">[mysqld]</span>
<span class="token constant">innodb_data_home_dir</span> <span class="token attr-value"><span class="token punctuation">=</span> /myibdata/</span>
<span class="token constant">innodb_data_file_path</span><span class="token attr-value"><span class="token punctuation">=</span>ibdata1:50M:autoextend</span></code></pre>
   </div>
   <p>
    A trailing slash is required when specifying a value for
    <a class="link" href="innodb-parameters.html#sysvar_innodb_data_home_dir">
     <code class="literal">
      innodb_data_home_dir
     </code>
    </a>
    .
    <code class="literal">
     InnoDB
    </code>
    does not create directories, so ensure
        that the specified directory exists before you start the server.
        Also, ensure sure that the MySQL server has the proper access
        rights to create files in the directory.
   </p>
   <p>
    <code class="literal">
     InnoDB
    </code>
    forms the directory path for each data
        file by textually concatenating the value of
    <a class="link" href="innodb-parameters.html#sysvar_innodb_data_home_dir">
     <code class="literal">
      innodb_data_home_dir
     </code>
    </a>
    to the
        data file name. If
    <a class="link" href="innodb-parameters.html#sysvar_innodb_data_home_dir">
     <code class="literal">
      innodb_data_home_dir
     </code>
    </a>
    is not
        defined, the default value is
    <span class="quote">
     “
     <span class="quote">
      ./
     </span>
     ”
    </span>
    , which is the
        data directory. (The MySQL server changes its current working
        directory to the data directory when it begins executing.)
   </p>
   <p>
    Alternatively, you can specify an absolute path for system
        tablespace data files. The following configuration is equivalent
        to the preceding one:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa28737378"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-ini"><span class="token selector">[mysqld]</span>
<span class="token constant">innodb_data_file_path</span><span class="token attr-value"><span class="token punctuation">=</span>/myibdata/ibdata1:50M:autoextend</span></code></pre>
   </div>
   <p>
    When you specify an absolute path for
    <a class="link" href="innodb-parameters.html#sysvar_innodb_data_file_path">
     <code class="literal">
      innodb_data_file_path
     </code>
    </a>
    , the
        setting is not concatenated with the
    <a class="link" href="innodb-parameters.html#sysvar_innodb_data_home_dir">
     <code class="literal">
      innodb_data_home_dir
     </code>
    </a>
    setting.
        System tablespace files are created in the specified absolute
        path. The specified directory must exist before you start the
        server.
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="innodb-startup-doublewrite-file-config">
       </a>
       InnoDB Doublewrite Buffer File Configuration
      </h4>
     </div>
    </div>
   </div>
   <p>
    The
    <code class="literal">
     InnoDB
    </code>
    doublewrite buffer storage area
        resides in doublewrite files, which provides flexibility with
        respect to the storage location of doublewrite pages. In
        previous releases, the doublewrite buffer storage area resided
        in the system tablespace. The
    <a class="link" href="innodb-parameters.html#sysvar_innodb_doublewrite_dir">
     <code class="literal">
      innodb_doublewrite_dir
     </code>
    </a>
    variable
        defines the directory where
    <code class="literal">
     InnoDB
    </code>
    creates
        doublewrite files at startup. If no directory is specified,
        doublewrite files are created in the
    <a class="link" href="innodb-parameters.html#sysvar_innodb_data_home_dir">
     <code class="literal">
      innodb_data_home_dir
     </code>
    </a>
    directory,
        which defaults to the data directory if unspecified.
   </p>
   <p>
    To have doublewrite files created in a location other than the
    <a class="link" href="innodb-parameters.html#sysvar_innodb_data_home_dir">
     <code class="literal">
      innodb_data_home_dir
     </code>
    </a>
    directory,
        configure
    <a class="link" href="innodb-parameters.html#sysvar_innodb_doublewrite_dir">
     <code class="literal">
      innodb_doublewrite_dir
     </code>
    </a>
    variable. For example:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-ini"><div class="docs-select-all right" id="sa14658878"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-ini"><span class="token constant">innodb_doublewrite_dir</span><span class="token attr-value"><span class="token punctuation">=</span><em class="replaceable">/path/to/doublewrite_directory</em></span></code></pre>
   </div>
   <p>
    Other doublewrite buffer variables permit defining the number of
        doublewrite files, the number of pages per thread, and the
        doublewrite batch size. For more information about doublewrite
        buffer configuration, see
    <a class="xref" href="innodb-doublewrite-buffer.html" title="17.6.4 Doublewrite Buffer">
     Section 17.6.4, “Doublewrite Buffer”
    </a>
    .
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="innodb-startup-log-file-configuration">
       </a>
       Redo Log Configuration
      </h4>
     </div>
    </div>
   </div>
   <p>
    The amount of disk space occupied by redo log files is
        controlled by the
    <a class="link" href="innodb-parameters.html#sysvar_innodb_redo_log_capacity">
     <code class="literal">
      innodb_redo_log_capacity
     </code>
    </a>
    variable, which can be set at startup or runtime; for example,
        to set the variable to 8GiB in an option file, add the following
        entry:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa96900745"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-ini"><span class="token selector">[mysqld]</span>
<span class="token constant">innodb_redo_log_capacity</span> <span class="token attr-value"><span class="token punctuation">=</span> 8589934592</span></code></pre>
   </div>
   <p>
    For information about configuring redo log capacity at runtime,
        see
    <a class="xref" href="innodb-redo-log.html#innodb-modifying-redo-log-capacity" title="Configuring Redo Log Capacity">
     Configuring Redo Log Capacity
    </a>
    .
   </p>
   <p>
    The
    <a class="link" href="innodb-parameters.html#sysvar_innodb_redo_log_capacity">
     <code class="literal">
      innodb_redo_log_capacity
     </code>
    </a>
    variable supersedes the
    <a class="link" href="innodb-parameters.html#sysvar_innodb_log_file_size">
     <code class="literal">
      innodb_log_file_size
     </code>
    </a>
    and
    <a class="link" href="innodb-parameters.html#sysvar_innodb_log_files_in_group">
     <code class="literal">
      innodb_log_files_in_group
     </code>
    </a>
    variables, which are deprecated. When the
    <code class="literal">
     innodb_redo_log_capacity
    </code>
    setting is defined,
        the
    <code class="literal">
     innodb_log_file_size
    </code>
    and
    <code class="literal">
     innodb_log_files_in_group
    </code>
    settings are
        ignored; otherwise, if one or both of these deprecated settings
        are defined then they are used to compute
    <a class="link" href="server-status-variables.html#statvar_Innodb_redo_log_capacity_resized">
     <code class="literal">
      Innodb_redo_log_capacity_resized
     </code>
    </a>
    as (
    <code class="literal">
     innodb_log_files_in_group
    </code>
    *
    <code class="literal">
     innodb_log_file_size
    </code>
    ). If none of those
        variables are set, then the default
    <code class="literal">
     innodb_redo_log_capacity
    </code>
    value is used.
   </p>
   <p>
    <code class="literal">
     InnoDB
    </code>
    attempts to maintain 32 redo log
        files, with each file equal to 1/32 *
    <code class="literal">
     innodb_redo_log_capacity
    </code>
    . The redo log files
        reside in the
    <code class="filename">
     #innodb_redo
    </code>
    directory in the
        data directory unless a different directory was specified by the
    <a class="link" href="innodb-parameters.html#sysvar_innodb_log_group_home_dir">
     <code class="literal">
      innodb_log_group_home_dir
     </code>
    </a>
    variable. If
    <code class="literal">
     innodb_log_group_home_dir
    </code>
    was
        defined, the redo log files reside in the
    <code class="filename">
     #innodb_redo
    </code>
    directory in that directory.
        For more information, see
    <a class="xref" href="innodb-redo-log.html" title="17.6.5 Redo Log">
     Section 17.6.5, “Redo Log”
    </a>
    .
   </p>
   <p>
    You can define a different number of redo log files and
        different redo log file size when initializing the MySQL Server
        instance by configuring the
    <a class="link" href="innodb-parameters.html#sysvar_innodb_log_files_in_group">
     <code class="literal">
      innodb_log_files_in_group
     </code>
    </a>
    and
    <a class="link" href="innodb-parameters.html#sysvar_innodb_log_file_size">
     <code class="literal">
      innodb_log_file_size
     </code>
    </a>
    variables.
   </p>
   <p>
    <a class="link" href="innodb-parameters.html#sysvar_innodb_log_files_in_group">
     <code class="literal">
      innodb_log_files_in_group
     </code>
    </a>
    defines the number of log files in the log group. The default
        and recommended value is 2.
   </p>
   <p>
    <a class="link" href="innodb-parameters.html#sysvar_innodb_log_file_size">
     <code class="literal">
      innodb_log_file_size
     </code>
    </a>
    defines
        the size in bytes of each log file in the log group. The
        combined log file size
        (
    <a class="link" href="innodb-parameters.html#sysvar_innodb_log_file_size">
     <code class="literal">
      innodb_log_file_size
     </code>
    </a>
    *
    <a class="link" href="innodb-parameters.html#sysvar_innodb_log_files_in_group">
     <code class="literal">
      innodb_log_files_in_group
     </code>
    </a>
    )
        cannot exceed the maximum value, which is slightly less than
        512GB. A pair of 255 GB log files, for example, approaches the
        limit but does not exceed it. The default log file size is 48MB.
        Generally, the combined size of the log files should be large
        enough that the server can smooth out peaks and troughs in
        workload activity, which often means that there is enough redo
        log space to handle more than an hour of write activity. A
        larger log file size means less checkpoint flush activity in the
        buffer pool, which reduces disk I/O. For additional information,
        see
    <a class="xref" href="optimizing-innodb-logging.html" title="10.5.4 Optimizing InnoDB Redo Logging">
     Section 10.5.4, “Optimizing InnoDB Redo Logging”
    </a>
    .
   </p>
   <p>
    The
    <a class="link" href="innodb-parameters.html#sysvar_innodb_log_group_home_dir">
     <code class="literal">
      innodb_log_group_home_dir
     </code>
    </a>
    defines the directory path to the
    <code class="literal">
     InnoDB
    </code>
    log
        files. You might use this option to place
    <code class="literal">
     InnoDB
    </code>
    redo log files in a different physical
        storage location than
    <code class="literal">
     InnoDB
    </code>
    data files to
        avoid potential I/O resource conflicts; for example:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa39295694"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-ini"><span class="token selector">[mysqld]</span>
<span class="token constant">innodb_log_group_home_dir</span> <span class="token attr-value"><span class="token punctuation">=</span> /dr3/iblogs</span></code></pre>
   </div>
   <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Note
    </div>
    <p>
     <code class="literal">
      InnoDB
     </code>
     does not create directories, so make
          sure that the log directory exists before you start the
          server. Use the Unix or DOS
     <code class="literal">
      mkdir
     </code>
     command
          to create any necessary directories.
    </p>
    <p>
     Make sure that the MySQL server has the proper access rights
          to create files in the log directory. More generally, the
          server must have access rights in any directory where it needs
          to create files.
    </p>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="innodb-startup-undo-tablespace">
       </a>
       Undo Tablespace Configuration
      </h4>
     </div>
    </div>
   </div>
   <p>
    Undo logs, by default, reside in two undo tablespaces created
        when the MySQL instance is initialized.
   </p>
   <p>
    The
    <a class="link" href="innodb-parameters.html#sysvar_innodb_undo_directory">
     <code class="literal">
      innodb_undo_directory
     </code>
    </a>
    variable defines the path where
    <code class="literal">
     InnoDB
    </code>
    creates default undo tablespaces. If that variable is undefined,
        default undo tablespaces are created in the data directory. The
    <a class="link" href="innodb-parameters.html#sysvar_innodb_undo_directory">
     <code class="literal">
      innodb_undo_directory
     </code>
    </a>
    variable
        is not dynamic. Configuring it requires restarting the server.
   </p>
   <p>
    The I/O patterns for undo logs make undo tablespaces good
        candidates for
    <a class="link" href="glossary.html#glos_ssd" title="SSD">
     SSD
    </a>
    storage.
   </p>
   <p>
    For information about configuring additional undo tablespaces,
        see
    <a class="xref" href="innodb-undo-tablespaces.html" title="17.6.3.4 Undo Tablespaces">
     Section 17.6.3.4, “Undo Tablespaces”
    </a>
    .
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="innodb-startup-temporary-tablespace">
       </a>
       Global Temporary Tablespace Configuration
      </h4>
     </div>
    </div>
   </div>
   <p>
    The global temporary tablespace stores rollback segments for
        changes made to user-created temporary tables.
   </p>
   <p>
    A single auto-extending global temporary tablespace data file
        named
    <code class="filename">
     ibtmp1
    </code>
    in the
    <a class="link" href="innodb-parameters.html#sysvar_innodb_data_home_dir">
     <code class="literal">
      innodb_data_home_dir
     </code>
    </a>
    directory
        by default. The initial file size is slightly larger than 12MB.
   </p>
   <p>
    The
    <a class="link" href="innodb-parameters.html#sysvar_innodb_temp_data_file_path">
     <code class="literal">
      innodb_temp_data_file_path
     </code>
    </a>
    option specifies the path, file name, and file size for global
        temporary tablespace data files. File size is specified in KB,
        MB, or GB by appending K, M, or G to the size value. The file
        size or combined file size must be slightly larger than 12MB.
   </p>
   <p>
    To specify an alternate location for global temporary tablespace
        data files, configure the
    <a class="link" href="innodb-parameters.html#sysvar_innodb_temp_data_file_path">
     <code class="literal">
      innodb_temp_data_file_path
     </code>
    </a>
    option at startup.
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="innodb-startup-session-temporary-tablespaces">
       </a>
       Session Temporary Tablespace Configuration
      </h4>
     </div>
    </div>
   </div>
   <p>
    In MySQL 8.4,
    <code class="literal">
     InnoDB
    </code>
    is always
        used as the on-disk storage engine for internal temporary
        tables.
   </p>
   <p>
    The
    <a class="link" href="innodb-parameters.html#sysvar_innodb_temp_tablespaces_dir">
     <code class="literal">
      innodb_temp_tablespaces_dir
     </code>
    </a>
    variable defines the location where
    <code class="literal">
     InnoDB
    </code>
    creates session temporary tablespaces. The default location is
        the
    <code class="filename">
     #innodb_temp
    </code>
    directory in the data
        directory.
   </p>
   <p>
    To specify an alternate location for session temporary
        tablespaces, configure the
    <a class="link" href="innodb-parameters.html#sysvar_innodb_temp_tablespaces_dir">
     <code class="literal">
      innodb_temp_tablespaces_dir
     </code>
    </a>
    variable at startup. A fully qualified path or path relative to
        the data directory is permitted.
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="innodb-startup-page-size">
       </a>
       Page Size Configuration
      </h4>
     </div>
    </div>
   </div>
   <p>
    The
    <a class="link" href="innodb-parameters.html#sysvar_innodb_page_size">
     <code class="literal">
      innodb_page_size
     </code>
    </a>
    option
        specifies the page size for all
    <code class="literal">
     InnoDB
    </code>
    tablespaces in a MySQL instance. This value is set when the
        instance is created and remains constant afterward. Valid values
        are 64KB, 32KB, 16KB (the default), 8KB, and 4KB. Alternatively,
        you can specify page size in bytes (65536, 32768, 16384, 8192,
        4096).
   </p>
   <p>
    The default 16KB page size is appropriate for a wide range of
        workloads, particularly for queries involving table scans and
        DML operations involving bulk updates. Smaller page sizes might
        be more efficient for OLTP workloads involving many small
        writes, where contention can be an issue when a single page
        contains many rows. Smaller pages can also be more efficient for
        SSD storage devices, which typically use small block sizes.
        Keeping the
    <code class="literal">
     InnoDB
    </code>
    page size close to the
        storage device block size minimizes the amount of unchanged data
        that is rewritten to disk.
   </p>
   <div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Important
    </div>
    <p>
     <a class="link" href="innodb-parameters.html#sysvar_innodb_page_size">
      <code class="literal">
       innodb_page_size
      </code>
     </a>
     can be set
          only when initializing the data directory. See the description
          of this variable for more information.
    </p>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="innodb-startup-memory-configuration">
       </a>
       Memory Configuration
      </h4>
     </div>
    </div>
   </div>
   <p>
    MySQL allocates memory to various caches and buffers to improve
        performance of database operations. When allocating memory for
    <code class="literal">
     InnoDB
    </code>
    , always consider memory required by
        the operating system, memory allocated to other applications,
        and memory allocated for other MySQL buffers and caches. For
        example, if you use
    <code class="literal">
     MyISAM
    </code>
    tables, consider
        the amount of memory allocated for the key buffer
        (
    <a class="link" href="server-system-variables.html#sysvar_key_buffer_size">
     <code class="literal">
      key_buffer_size
     </code>
    </a>
    ). For an
        overview of MySQL buffers and caches, see
    <a class="xref" href="memory-use.html" title="10.12.3.1 How MySQL Uses Memory">
     Section 10.12.3.1, “How MySQL Uses Memory”
    </a>
    .
   </p>
   <p>
    Buffers specific to
    <code class="literal">
     InnoDB
    </code>
    are configured
        using the following parameters:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <a class="link" href="innodb-parameters.html#sysvar_innodb_buffer_pool_size">
        <code class="literal">
         innodb_buffer_pool_size
        </code>
       </a>
       defines size of the buffer pool, which is the memory area
            that holds cached data for
       <code class="literal">
        InnoDB
       </code>
       tables,
            indexes, and other auxiliary buffers. The size of the buffer
            pool is important for system performance, and it is
            typically recommended that
       <a class="link" href="innodb-parameters.html#sysvar_innodb_buffer_pool_size">
        <code class="literal">
         innodb_buffer_pool_size
        </code>
       </a>
       is
            configured to 50 to 75 percent of system memory. The default
            buffer pool size is 128MB. For additional guidance, see
       <a class="xref" href="memory-use.html" title="10.12.3.1 How MySQL Uses Memory">
        Section 10.12.3.1, “How MySQL Uses Memory”
       </a>
       . For information about how to
            configure
       <code class="literal">
        InnoDB
       </code>
       buffer pool size, see
       <a class="xref" href="innodb-buffer-pool-resize.html" title="17.8.3.1 Configuring InnoDB Buffer Pool Size">
        Section 17.8.3.1, “Configuring InnoDB Buffer Pool Size”
       </a>
       . Buffer pool
            size can be configured at startup or dynamically.
      </p>
      <p>
       On systems with a large amount of memory, you can improve
            concurrency by dividing the buffer pool into multiple buffer
            pool instances. The number of buffer pool instances is
            controlled by the by
       <a class="link" href="innodb-parameters.html#sysvar_innodb_buffer_pool_instances">
        <code class="literal">
         innodb_buffer_pool_instances
        </code>
       </a>
       option. By default,
       <code class="literal">
        InnoDB
       </code>
       creates one
            buffer pool instance. The number of buffer pool instances
            can be configured at startup. For more information, see
       <a class="xref" href="innodb-multiple-buffer-pools.html" title="17.8.3.2 Configuring Multiple Buffer Pool Instances">
        Section 17.8.3.2, “Configuring Multiple Buffer Pool Instances”
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="link" href="innodb-parameters.html#sysvar_innodb_log_buffer_size">
        <code class="literal">
         innodb_log_buffer_size
        </code>
       </a>
       defines the size of the buffer that
       <code class="literal">
        InnoDB
       </code>
       uses to write to the log files on
            disk. The default size is 64MB. A large log buffer enables
            large transactions to run without writing the log to disk
            before the transactions commit. If you have transactions
            that update, insert, or delete many rows, you might consider
            increasing the size of the log buffer to save disk I/O.
       <a class="link" href="innodb-parameters.html#sysvar_innodb_log_buffer_size">
        <code class="literal">
         innodb_log_buffer_size
        </code>
       </a>
       can
            be configured at startup. For related information, see
       <a class="xref" href="optimizing-innodb-logging.html" title="10.5.4 Optimizing InnoDB Redo Logging">
        Section 10.5.4, “Optimizing InnoDB Redo Logging”
       </a>
       .
      </p>
     </li>
    </ul>
   </div>
   <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Warning
    </div>
    <p>
     On 32-bit GNU/Linux x86, if memory usage is set too high,
     <code class="literal">
      glibc
     </code>
     may permit the process heap to grow
          over the thread stacks, causing a server failure. It is a risk
          if the memory allocated to the
     <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
      <span class="command">
       <strong>
        mysqld
       </strong>
      </span>
     </a>
     process for global and per-thread buffers and caches is close
          to or exceeds 2GB.
    </p>
    <p>
     A formula similar to the following that calculates global and
          per-thread memory allocation for MySQL can be used to estimate
          MySQL memory usage. You may need to modify the formula to
          account for buffers and caches in your MySQL version and
          configuration. For an overview of MySQL buffers and caches,
          see
     <a class="xref" href="memory-use.html" title="10.12.3.1 How MySQL Uses Memory">
      Section 10.12.3.1, “How MySQL Uses Memory”
     </a>
     .
    </p>
    <div class="copytoclipboard-wrapper">
     <pre class="programlisting language-none"><div class="docs-select-all right" id="sa43913281"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-none">innodb_buffer_pool_size
+ key_buffer_size
+ max_connections*(sort_buffer_size+read_buffer_size+binlog_cache_size)
+ max_connections*2MB</code></pre>
    </div>
    <p>
     Each thread uses a stack (often 2MB, but only 256KB in MySQL
          binaries provided by Oracle Corporation.) and in the worst
          case also uses
     <code class="literal">
      sort_buffer_size +
          read_buffer_size
     </code>
     additional memory.
    </p>
   </div>
   <p>
    On Linux, if the kernel is enabled for large page support,
    <code class="literal">
     InnoDB
    </code>
    can use large pages to allocate memory
        for its buffer pool. See
    <a class="xref" href="large-page-support.html" title="10.12.3.3 Enabling Large Page Support">
     Section 10.12.3.3, “Enabling Large Page Support”
    </a>
    .
   </p>
  </div>
 </div>
 <br/>
</div>
