<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="mysql-cluster-ndbinfo-diskpagebuffer">
      </a>
      25.6.17.31 The ndbinfo diskpagebuffer Table
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045089450048">
  </a>
  <p>
   The
   <code class="literal">
    diskpagebuffer
   </code>
   table provides statistics
        about disk page buffer usage by NDB Cluster Disk Data tables.
  </p>
  <p>
   The
   <code class="literal">
    diskpagebuffer
   </code>
   table contains the
        following columns:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       node_id
      </code>
     </p>
     <p>
      The data node ID
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       block_instance
      </code>
     </p>
     <p>
      Block instance
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       pages_written
      </code>
     </p>
     <p>
      Number of pages written to disk.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       pages_written_lcp
      </code>
     </p>
     <p>
      Number of pages written by local checkpoints.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       pages_read
      </code>
     </p>
     <p>
      Number of pages read from disk
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       log_waits
      </code>
     </p>
     <p>
      Number of page writes waiting for log to be written to disk
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       page_requests_direct_return
      </code>
     </p>
     <p>
      Number of requests for pages that were available in buffer
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       page_requests_wait_queue
      </code>
     </p>
     <p>
      Number of requests that had to wait for pages to become
            available in buffer
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       page_requests_wait_io
      </code>
     </p>
     <p>
      Number of requests that had to be read from pages on disk
            (pages were unavailable in buffer)
     </p>
    </li>
   </ul>
  </div>
  <h5>
   <a name="idm46045089428400">
   </a>
   Notes
  </h5>
  <p>
   You can use this table with NDB Cluster Disk Data tables to
        determine whether
   <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-diskpagebuffermemory">
    <code class="literal">
     DiskPageBufferMemory
    </code>
   </a>
   is
        sufficiently large to allow data to be read from the buffer
        rather from disk; minimizing disk seeks can help improve
        performance of such tables.
  </p>
  <p>
   You can determine the proportion of reads from
   <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-diskpagebuffermemory">
    <code class="literal">
     DiskPageBufferMemory
    </code>
   </a>
   to
        the total number of reads using a query such as this one, which
        obtains this ratio as a percentage:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa96163295"><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 keyword">SELECT</span>
  node_id<span class="token punctuation">,</span>
  <span class="token number">100</span> <span class="token operator">*</span> page_requests_direct_return <span class="token operator">/</span>
    <span class="token punctuation">(</span>page_requests_direct_return <span class="token operator">+</span> page_requests_wait_io<span class="token punctuation">)</span>
      <span class="token keyword">AS</span> hit_ratio
<span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>diskpagebuffer<span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   The result from this query should be similar to what is shown
        here, with one row for each data node in the cluster (in this
        example, the cluster has 4 data nodes):
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa7522426"><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 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>
<span class="token output"><span class="token punctuation">|</span> node_id <span class="token punctuation">|</span> hit_ratio <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>
<span class="token output"><span class="token punctuation">|</span>       5 <span class="token punctuation">|</span>   97.6744 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>       6 <span class="token punctuation">|</span>   97.6879 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>       7 <span class="token punctuation">|</span>   98.1776 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>       8 <span class="token punctuation">|</span>   98.1343 <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>
<span class="token output">4 rows in set (0.00 sec)</span></code></pre>
  </div>
  <p>
   <code class="literal">
    hit_ratio
   </code>
   values approaching 100% indicate
        that only a very small number of reads are being made from disk
        rather than from the buffer, which means that Disk Data read
        performance is approaching an optimum level. If any of these
        values are less than 95%, this is a strong indicator that the
        setting for
   <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-diskpagebuffermemory">
    <code class="literal">
     DiskPageBufferMemory
    </code>
   </a>
   needs to be increased in the
   <code class="filename">
    config.ini
   </code>
   file.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    A change in
    <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-diskpagebuffermemory">
     <code class="literal">
      DiskPageBufferMemory
     </code>
    </a>
    requires a rolling restart of all of the cluster's data
          nodes before it takes effect.
   </p>
  </div>
  <p>
   <code class="literal">
    block_instance
   </code>
   refers to an instance of a
        kernel block. Together with the block name, this number can be
        used to look up a given instance in the
   <a class="link" href="mysql-cluster-ndbinfo-threadblocks.html" title="25.6.17.62 The ndbinfo threadblocks Table">
    <code class="literal">
     threadblocks
    </code>
   </a>
   table. Using this
        information, you can obtain information about disk page buffer
        metrics relating to individual threads; an example query using
   <code class="literal">
    LIMIT 1
   </code>
   to limit the output to a single
        thread is shown here:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa95476951"><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">SELECT</span>
     <span class="token operator">&gt;</span>   node_id<span class="token punctuation">,</span> thr_no<span class="token punctuation">,</span> block_name<span class="token punctuation">,</span> thread_name<span class="token punctuation">,</span> pages_written<span class="token punctuation">,</span>
     <span class="token operator">&gt;</span>   pages_written_lcp<span class="token punctuation">,</span> pages_read<span class="token punctuation">,</span> log_waits<span class="token punctuation">,</span>
     <span class="token operator">&gt;</span>   page_requests_direct_return<span class="token punctuation">,</span> page_requests_wait_queue<span class="token punctuation">,</span>
     <span class="token operator">&gt;</span>   page_requests_wait_io
     <span class="token operator">&gt;</span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>diskpagebuffer
     <span class="token operator">&gt;</span>   <span class="token keyword">INNER</span> <span class="token keyword">JOIN</span> ndbinfo<span class="token punctuation">.</span>threadblocks <span class="token keyword">USING</span> <span class="token punctuation">(</span>node_id<span class="token punctuation">,</span> block_instance<span class="token punctuation">)</span>
     <span class="token operator">&gt;</span>   <span class="token keyword">INNER</span> <span class="token keyword">JOIN</span> ndbinfo<span class="token punctuation">.</span>threads <span class="token keyword">USING</span> <span class="token punctuation">(</span>node_id<span class="token punctuation">,</span> thr_no<span class="token punctuation">)</span>
     <span class="token operator">&gt;</span> <span class="token keyword">WHERE</span> block_name <span class="token operator">=</span> <span class="token string">'PGMAN'</span> <span class="token keyword">LIMIT</span> <span class="token number">1</span>\G
<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> 1. row <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>
                    node_id<span class="token punctuation">:</span> 1
                     thr_no<span class="token punctuation">:</span> 1
                 block_name<span class="token punctuation">:</span> PGMAN
                thread_name<span class="token punctuation">:</span> rep
              pages_written<span class="token punctuation">:</span> 0
          pages_written_lcp<span class="token punctuation">:</span> 0
                 pages_read<span class="token punctuation">:</span> 1
                  log_waits<span class="token punctuation">:</span> 0
page_requests_direct_return<span class="token punctuation">:</span> 4
   page_requests_wait_queue<span class="token punctuation">:</span> 0
      page_requests_wait_io<span class="token punctuation">:</span> 1
</span><span class="token output">1 row in set (0.01 sec)</span></code></pre>
  </div>
 </div>
 <br/>
</div>
