title: MySQL - max_binlog_cache_size vs binlog_cache_size
body: <p>There is quite a lot of confusion in the description of these variables, in official documentation of MySQL.</p>
  
  <p>According to it, <strong>max_binlog_cache_size</strong> means,</p>
  
  <blockquote>
    <p>If a transaction requires more than this many bytes of memory, the
    server generates a Multi-statement transaction required more than
    'max_binlog_cache_size' bytes of storage error.</p>
    
    <p>max_binlog_cache_size sets the size for the transaction cache only</p>
  </blockquote>
  
  <p>and <strong>binlog_cache_size</strong> means,</p>
  
  <blockquote>
    <p>The size of the cache to hold changes to the binary log during a
    transaction.</p>
    
    <p>binlog_cache_size sets the size for the transaction cache only</p>
  </blockquote>
  
  <p>On reading the documentation, I observed there is no difference among these two. There is also something very confusing in the documentation like,</p>
  
  <blockquote>
    <p>In MySQL 5.7, the visibility to sessions of max_binlog_cache_size
    matches that of the binlog_cache_size system variable; in other words,
    changing its value effects only new sessions that are started after
    the value is changed.</p>
  </blockquote>
  
  <p>When I query the server variables it shows both. I have a <strong>MySQL 5.6</strong> and a <strong>MySQL 5.7</strong>. All I need to know is, which variable I should consider and configure for which server.</p>
  
  <p><strong>binlog_cache_size</strong> for <strong>MySQL 5.6</strong> and <strong>max_binlog_cache_size</strong> for <strong>MySQL 5.7</strong>??</p>
  
  <p>There are additional confusing variables <strong>max_binlog_stmt_cache_size</strong> and <strong>binlog_stmt_cache_size</strong>, related to these.</p>