{"id":465,"date":"2013-06-01T21:03:47","date_gmt":"2013-06-01T13:03:47","guid":{"rendered":"http:\/\/www.brainfart.sg\/?p=465"},"modified":"2020-07-08T14:36:27","modified_gmt":"2020-07-08T06:36:27","slug":"mariadb-memory-footprint","status":"publish","type":"post","link":"https:\/\/www.brainfart.sg\/index.php\/2013\/06\/mariadb-memory-footprint\/","title":{"rendered":"MariaDB Memory Footprint"},"content":{"rendered":"<p>Recently, I&#8217;ve upgraded the database of this blog from MySQL to MariaDB.<\/p>\n<p>For those of you who are not aware, MariaDB is a fork from MySQL by the original founder of MySQL.<br \/>\nMariaDB 5.5 is fully compatible with MySQL 5.5 and can be replaced by &#8220;dropping in&#8221; directly over MySQL.<\/p>\n<p>What I noticed after upgrading to MariaDB was that the memory usage shot up to close to my VPS limit.<br \/>\nAs my VPS has limited memory, this sudden memory increase might create problems down the road.<\/p>\n<p>After investigating the possible causes, it was traced to the new database engine introduced in MariaDB, the Aria Storage Engine.<\/p>\n<p>According to the <a title=\"Aria storage Engine - AskMonty KnowledgeBase\" href=\"https:\/\/kb.askmonty.org\/en\/aria-storage-engine\/\" target=\"_blank\" rel=\"noopener noreferrer\">Knowledge Base<\/a>, the default buffer size is 128M, a pretty big number for a VPS with only 512M of available memory.<br \/>\nSince I&#8217;m still using the ISAM engine and have no need to use the Aria engine, it should be turned off to reduce the memory usage.<br \/>\nHowever, as the storage engine is an integral part of the DBMS, it couldn&#8217;t be turned off, so the next best thing would be to tune the config in my.cnf<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n[mariadb]\naria_pagecache_buffer_size = 512k\naria_sort_buffer_size = 16k\n<\/pre>\n<p>There, after tuning the buffer size to 512K and 16K, the memory usage is back to normal.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently, I&#8217;ve upgraded the database of this blog from MySQL to MariaDB. For those of you who are not aware, MariaDB is a fork from MySQL by the original founder of MySQL. MariaDB 5.5 is fully compatible with MySQL 5.5&hellip; <a href=\"https:\/\/www.brainfart.sg\/index.php\/2013\/06\/mariadb-memory-footprint\/\" class=\"more-link\">Continue Reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":582,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":{"spay_email":""},"categories":[17],"tags":[93,92,95,96,94],"jetpack_featured_media_url":"https:\/\/www.brainfart.sg\/wp-content\/uploads\/2016\/09\/library-mariadb-logo.png","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1T66h-7v","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.brainfart.sg\/index.php\/wp-json\/wp\/v2\/posts\/465"}],"collection":[{"href":"https:\/\/www.brainfart.sg\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.brainfart.sg\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.brainfart.sg\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.brainfart.sg\/index.php\/wp-json\/wp\/v2\/comments?post=465"}],"version-history":[{"count":7,"href":"https:\/\/www.brainfart.sg\/index.php\/wp-json\/wp\/v2\/posts\/465\/revisions"}],"predecessor-version":[{"id":584,"href":"https:\/\/www.brainfart.sg\/index.php\/wp-json\/wp\/v2\/posts\/465\/revisions\/584"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.brainfart.sg\/index.php\/wp-json\/wp\/v2\/media\/582"}],"wp:attachment":[{"href":"https:\/\/www.brainfart.sg\/index.php\/wp-json\/wp\/v2\/media?parent=465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.brainfart.sg\/index.php\/wp-json\/wp\/v2\/categories?post=465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.brainfart.sg\/index.php\/wp-json\/wp\/v2\/tags?post=465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}