{"id":3122,"date":"2016-04-15T16:49:58","date_gmt":"2016-04-15T16:49:58","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=3122"},"modified":"2016-04-15T16:49:58","modified_gmt":"2016-04-15T16:49:58","slug":"large-mysql-innodb_buffer_pool_size","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2016\/04\/15\/large-mysql-innodb_buffer_pool_size\/","title":{"rendered":"How large should be mysql innodb_buffer_pool_size?"},"content":{"rendered":"<p>First &#8211; run mysqltuner:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n]# .\/mysqltuner.pl\n &gt;&gt;  MySQLTuner 1.6.4 - Major Hayden &lt;major@mhtx.net&gt;\n &gt;&gt;  Bug reports, feature requests, and downloads at http:\/\/mysqltuner.com\/\n &gt;&gt;  Run with &#039;--help&#039; for additional options and output filtering\nPlease enter your MySQL administrative login: root\nPlease enter your MySQL administrative password:\n&#x5B;--] Skipped version check for MySQLTuner script\n&#x5B;OK] Currently running supported MySQL version 5.6.29-log\n&#x5B;OK] Operating on 64-bit architecture\n\n-------- Storage Engine Statistics -------------------------------------------\n&#x5B;--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM\n&#x5B;--] Data in MyISAM tables: 445K (Tables: 9)\n&#x5B;--] Data in InnoDB tables: 204M (Tables: 13)\n&#x5B;!!] Total fragmented tables: 3\n\n-------- Security Recommendations  -------------------------------------------\n&#x5B;OK] There are no anonymous accounts for any database users\n&#x5B;OK] All database users have passwords assigned\n&#x5B;!!] User &#039;sysadmin@%&#039; hasn&#039;t specific host restriction.\n&#x5B;!!] There is no basic password file list!\n\n-------- CVE Security Recommendations  ---------------------------------------\n&#x5B;--] Skipped due to --cvefile option undefined\n\n-------- Performance Metrics -------------------------------------------------\n&#x5B;--] Up for: 17d 19h 48m 54s (1M q &#x5B;0.865 qps], 87K conn, TX: 39B, RX: 258M)\n&#x5B;--] Reads \/ Writes: 94% \/ 6%\n&#x5B;--] Binary logging is enabled (GTID MODE: OFF)\n&#x5B;--] Total buffers: 432.0M global + 6.5M per thread (151 max threads)\n&#x5B;OK] Maximum reached memory usage: 913.0M (49.61% of installed RAM)\n&#x5B;OK] Maximum possible memory usage: 1.4G (76.81% of installed RAM)\n&#x5B;OK] Slow queries: 0% (1\/1M)\n&#x5B;OK] Highest usage of available connections: 49% (74\/151)\n&#x5B;OK] Aborted connections: 2.80%  (2442\/87276)\n&#x5B;!!] Query cache is disabled\n&#x5B;OK] Sorts requiring temporary tables: 0% (0 temp sorts \/ 271K sorts)\n&#x5B;!!] Temporary tables created on disk: 71% (80K on disk \/ 114K total)\n&#x5B;OK] Thread cache hit rate: 94% (4K created \/ 87K connections)\n&#x5B;!!] Table cache hit rate: 2% (115 open \/ 5K opened)\n&#x5B;OK] Open file limit used: 9% (99\/1K)\n&#x5B;OK] Table locks acquired immediately: 100% (1M immediate \/ 1M locks)\n&#x5B;OK] Binlog cache memory access: 99.95% ( 52384 Memory \/ 52412 Total)\n\n-------- MyISAM Metrics ------------------------------------------------------\n&#x5B;!!] Key buffer used: 18.3% (49M used \/ 268M cache)\n&#x5B;OK] Key buffer size \/ total MyISAM indexes: 256.0M\/291.0K\n&#x5B;OK] Read Key buffer hit rate: 100.0% (9M cached \/ 510 reads)\n&#x5B;!!] Write Key buffer hit rate: 1.4% (1K cached \/ 1K writes)\n\n-------- InnoDB Metrics ------------------------------------------------------\n&#x5B;--] InnoDB is enabled.\n&#x5B;!!] InnoDB buffer pool \/ data size: 128.0M\/204.8M\n&#x5B;!!] InnoDB buffer pool &lt;= 1G and innodb_buffer_pool_instances(!=1).\n&amp;#91;OK&amp;#93; InnoDB Used buffer: 87.50% (7167 used\/ 8191 total)\n&amp;#91;OK&amp;#93; InnoDB Read buffer efficiency: 99.97% (88883891 hits\/ 88912014 total)\n&amp;#91;OK&amp;#93; InnoDB Write log efficiency: 96.95% (869671 hits\/ 897014 total)\n&amp;#91;OK&amp;#93; InnoDB log waits: 0.00% (0 waits \/ 27343 writes)\n\n-------- ThreadPool Metrics --------------------------------------------------\n&amp;#91;--&amp;#93; ThreadPool stat is disabled.\n\n-------- AriaDB Metrics ------------------------------------------------------\n&amp;#91;--&amp;#93; AriaDB is disabled.\n\n-------- TokuDB Metrics ------------------------------------------------------\n&amp;#91;--&amp;#93; TokuDB is disabled.\n\n-------- Galera Metrics ------------------------------------------------------\n&amp;#91;--&amp;#93; Galera is disabled.\n\n-------- Replication Metrics -------------------------------------------------\n&amp;#91;--&amp;#93; No replication slave(s) for this server.\n&amp;#91;--&amp;#93; This is a standalone server..\n\n-------- Recommendations -----------------------------------------------------\nGeneral recommendations:\n    Run OPTIMIZE TABLE to defragment tables for better performance\n    Restrict Host for user@% to user@SpecificDNSorIp\n    When making adjustments, make tmp_table_size\/max_heap_table_size equal\n    Reduce your SELECT DISTINCT queries which have no LIMIT clause\n    Increase table_open_cache gradually to avoid file descriptor limits\n    Read this before increasing table_open_cache over 64: http:\/\/bit.ly\/1mi7c4C\n    Beware that open_files_limit (1024) variable\n    should be greater than table_open_cache ( 256)\nVariables to adjust:\n    query_cache_type (=1)\n    tmp_table_size (&gt; 16M)\n    max_heap_table_size (&gt; 16M)\n    table_open_cache (&gt; 256)\n    innodb_buffer_pool_size (&gt;= 204M) if possible.\n    innodb_buffer_pool_instances (=1)\n\n<\/pre>\n<p>Here is what you should do. First run this query<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n\nmysql&gt; SELECT CEILING(Total_InnoDB_Bytes*1.6\/POWER(1024,3)) RIBPS FROM\n    -&gt; (SELECT SUM(data_length+index_length) Total_InnoDB_Bytes\n    -&gt; FROM information_schema.tables WHERE engine=&#039;InnoDB&#039;) A;\n+-------+\n| RIBPS |\n+-------+\n|     1 |\n+-------+\n1 row in set (0.08 sec)\n\n<\/pre>\n<p>This will give you the RIBPS, Recommended InnoDB Buffer Pool Size (in GB)based on all InnoDB Data and Indexes with an additional 60%.<\/p>\n<p>After the restart, run mysql for a week or two. Then, run this query:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\nSELECT (PagesData*PageSize)\/POWER(1024,3) DataGB FROM\n(SELECT variable_value PagesData\nFROM information_schema.global_status\nWHERE variable_name=&#039;Innodb_buffer_pool_pages_data&#039;) A,\n(SELECT variable_value PageSize\nFROM information_schema.global_status\nWHERE variable_name=&#039;Innodb_page_size&#039;) B;\n\n<\/pre>\n<p>This will give you how many actual pages of InnoDB data reside in the InnoDB Buffer Pool.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First &#8211; run mysqltuner: ]# .\/mysqltuner.pl &gt;&gt; MySQLTuner 1.6.4 &#8211; Major Hayden &lt;major@mhtx.net&gt; &gt;&gt; Bug reports, feature requests, and downloads at http:\/\/mysqltuner.com\/ &gt;&gt; Run with &#039;&#8211;help&#039; for additional options and output filtering Please enter your MySQL administrative login: root Please enter your MySQL administrative password: &#x5B;&#8211;] Skipped version check for MySQLTuner script &#x5B;OK] Currently running &#8230; <a title=\"How large should be mysql innodb_buffer_pool_size?\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2016\/04\/15\/large-mysql-innodb_buffer_pool_size\/\" aria-label=\"Read more about How large should be mysql innodb_buffer_pool_size?\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70],"tags":[],"class_list":["post-3122","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/3122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=3122"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/3122\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=3122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=3122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=3122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}