{"id":1152,"date":"2026-09-17T02:39:09","date_gmt":"2026-09-17T02:39:09","guid":{"rendered":"https:\/\/virtualserversvps.com\/blog\/?p=1152"},"modified":"2026-10-05T22:02:30","modified_gmt":"2026-10-05T22:02:30","slug":"mysql-memory-budget-1gb-vps-tuning","status":"publish","type":"post","link":"https:\/\/virtualserversvps.com\/blog\/mysql-memory-budget-1gb-vps-tuning\/","title":{"rendered":"MySQL Memory Budget on a 1 GB VPS: Measuring Every Buffer Instead of Guessing"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Attribute the memory before you tune it. On a 1 GB VPS the question is never &#8220;is MySQL using memory&#8221; &mdash; it is which buffer holds the RSS and whether that buffer buys measurable throughput. Let MySQL&#8217;s own accounting answer that, rather than <code>top<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Start with the server&#8217;s own numbers<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">MySQL exposes its allocation decisions through performance schema and status variables. The buffer pool is the single largest line item on most installs, so measure it first &mdash; allocated versus actually used:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -e \"SELECT FORMAT(sum(current_alloc)\/1024\/1024,2) AS alloc_mb,\n                  FORMAT(sum(current_alloc-scale(1,0))\/*1,0)\n             FROM sys.memory_global_total;\"\nmysql -e \"SELECT variable_name, variable_value\n             FROM performance_schema.global_status\n            WHERE variable_name IN ('Innodb_buffer_pool_pages_data',\n                                    'Innodb_buffer_pool_pages_free',\n                                    'Innodb_buffer_pool_pages_total');\"\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If <code>pages_free<\/code> is a large fraction of <code>pages_total<\/code>, you have over-provisioned the pool and are paying for RAM you never touch. On a 1&nbsp;GB box that waste is often 150&ndash;250&nbsp;MB &mdash; enough to end a swap storm.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The components that actually consume RSS<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A MySQL RSS figure is the sum of several independent regions. Knowing each one tells you which to cut:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>InnoDB buffer pool<\/strong> &mdash; <code>innodb_buffer_pool_size<\/code>. Cache of data and index pages. The one knob worth real money.<\/li>\n<li><strong>Per-connection buffers<\/strong> &mdash; sort, join and read buffers are allocated <em>per session<\/em> on demand. <code>max_connections<\/code> multiplied by a few buffers is a worst-case figure that rarely materialises, but the ceiling still matters for OOM planning.<\/li>\n<li><strong>Performance schema tables<\/strong> &mdash; <code>performance_schema<\/code> can quietly consume tens of MB. Disable it if you are not querying it.<\/li>\n<li><strong>InnoDB log and dictionary caches<\/strong> &mdash; smaller, but non-zero on tiny hosts.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Enumerate the per-thread worst case with the maximum-memory view, which multiplies every session-level buffer by the current connection count:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -e \"SELECT ( @@read_buffer_size\n              + @@read_rnd_buffer_size\n              + @@sort_buffer_size\n              + @@join_buffer_size\n              + @@binlog_cache_size\n              + @@tmp_table_size )\n            \/ (1024*1024) AS per_conn_mb,\n            @@max_connections AS max_conn;\n\"\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Budgeting for 1 GB, step by step<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Leave room for the OS, the page cache the database relies on, and your web tier. A workable split on a 1&nbsp;GB instance running a small application:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>~256&ndash;384&nbsp;MB &mdash; InnoDB buffer pool (start at 256&nbsp;MB and grow only if <code>pages_free<\/code> stays low)<\/li>\n<li>~64&nbsp;MB &mdash; InnoDB log buffer + redo logs sized to disk, not RAM<\/li>\n<li>~150&nbsp;MB &mdash; worst-case session buffers at a sane <code>max_connections<\/code> of 30&ndash;50<\/li>\n<li>remainder &mdash; OS, page cache, PHP-FPM or your app runtime<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Apply the pool change dynamically where the server allows it, then prove the effect rather than trusting the config file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SET GLOBAL innodb_buffer_pool_size = 268435456;\n-- verify\nSELECT @@innodb_buffer_pool_size\/1024\/1024 AS pool_mb;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note that some versions only apply certain buffer changes after restart, and the value in the running server may differ from the one on disk. Always read it back from the live server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Watch it under load, not at idle<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A budget verified at idle is a guess. Drive representative queries and watch the states change; you can do this password-free with the extended-status counter that counts bytes read from disk versus from the pool:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-- two samples, a few seconds apart, under load\nSHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_read%';\n-- read_requests = logical reads, reads = physical disk reads\n-- ratio reveals true cache hit rate\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A hit rate below roughly 99% on a read-heavy workload means the pool is too small for the working set &mdash; but on a 1&nbsp;GB host you often cannot grow it, so the honest alternative is to shrink the working set (indexes, archiving) rather than the pool. This is the same memory-accounting discipline that separates a stable instance from one that <a href=\"https:\/\/virtualserversvps.com\/\">a well-run virtual server<\/a> can host comfortably from one that thrashes under the first traffic spike.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Guardrails beyond MySQL itself<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Set a floor for the OS and let the database fail loudly rather than be killed silently. Tune the kernel&#8217;s overcommit and swap behaviour so pressure is visible, and cap the MySQL process group so a runaway query cannot take the whole host down. On constrained instances this combination &mdash; a measured budget plus an external cap &mdash; is what makes memory behaviour predictable, which is fundamentally the point of choosing <a href=\"https:\/\/virtualserversvps.com\/\">premium cloud solutions<\/a> over an unmanaged slice that gives you no accounting at all.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Measure, budget, verify under load, then cap. The arithmetic is boring and repeatable; the swap storms it prevents are neither.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A measured breakdown of MySQL memory on a 1 GB VPS: how to read the buffer pool allocation, compute the per-connection worst case, and budget RAM without triggering swap.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":5,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1152","post","type-post","status-publish","format-standard","hentry","category-performance-optimization"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>MySQL Memory Budget on a 1 GB VPS: Measuring Every Buffer Instead of Guessing - Virtual Servers VPS Blog<\/title>\n<meta name=\"description\" content=\"A measured breakdown of MySQL memory on a 1 GB VPS: how to read the buffer pool allocation, compute the per-connection worst case, and budget RAM without triggering swap.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/virtualserversvps.com\/blog\/mysql-memory-budget-1gb-vps-tuning\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySQL Memory Budget on a 1 GB VPS: Measuring Every Buffer Instead of Guessing\" \/>\n<meta property=\"og:description\" content=\"MySQL Memory Budget on a 1 GB VPS: Measuring Every Buffer Instead of Guessing\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtualserversvps.com\/blog\/mysql-memory-budget-1gb-vps-tuning\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual Servers VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-17T02:39:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-05T22:02:30+00:00\" \/>\n<meta name=\"author\" content=\"Virtual-Servers-Vps-Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Virtual-Servers-Vps-Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/mysql-memory-budget-1gb-vps-tuning\/\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/mysql-memory-budget-1gb-vps-tuning\/\",\"name\":\"MySQL Memory Budget on a 1 GB VPS: Measuring Every Buffer Instead of Guessing - Virtual Servers VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\"},\"datePublished\":\"2026-09-17T02:39:09+00:00\",\"dateModified\":\"2026-10-05T22:02:30+00:00\",\"author\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\"},\"description\":\"A measured breakdown of MySQL memory on a 1 GB VPS: how to read the buffer pool allocation, compute the per-connection worst case, and budget RAM without triggering swap.\",\"breadcrumb\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/mysql-memory-budget-1gb-vps-tuning\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtualserversvps.com\/blog\/mysql-memory-budget-1gb-vps-tuning\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/mysql-memory-budget-1gb-vps-tuning\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtualserversvps.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MySQL Memory Budget on a 1 GB VPS: Measuring Every Buffer Instead of Guessing\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/\",\"name\":\"Virtual Servers VPS Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/virtualserversvps.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\",\"name\":\"Virtual-Servers-Vps-Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g\",\"caption\":\"Virtual-Servers-Vps-Editor\"},\"sameAs\":[\"https:\/\/virtualserversvps.com\/blog\"],\"url\":\"https:\/\/virtualserversvps.com\/blog\/author\/virtualserversvps\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"MySQL Memory Budget on a 1 GB VPS: Measuring Every Buffer Instead of Guessing - Virtual Servers VPS Blog","description":"A measured breakdown of MySQL memory on a 1 GB VPS: how to read the buffer pool allocation, compute the per-connection worst case, and budget RAM without triggering swap.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/virtualserversvps.com\/blog\/mysql-memory-budget-1gb-vps-tuning\/","og_locale":"en_US","og_type":"article","og_title":"MySQL Memory Budget on a 1 GB VPS: Measuring Every Buffer Instead of Guessing","og_description":"MySQL Memory Budget on a 1 GB VPS: Measuring Every Buffer Instead of Guessing","og_url":"https:\/\/virtualserversvps.com\/blog\/mysql-memory-budget-1gb-vps-tuning\/","og_site_name":"Virtual Servers VPS Blog","article_published_time":"2026-09-17T02:39:09+00:00","article_modified_time":"2026-10-05T22:02:30+00:00","author":"Virtual-Servers-Vps-Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Virtual-Servers-Vps-Editor","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/virtualserversvps.com\/blog\/mysql-memory-budget-1gb-vps-tuning\/","url":"https:\/\/virtualserversvps.com\/blog\/mysql-memory-budget-1gb-vps-tuning\/","name":"MySQL Memory Budget on a 1 GB VPS: Measuring Every Buffer Instead of Guessing - Virtual Servers VPS Blog","isPartOf":{"@id":"https:\/\/virtualserversvps.com\/blog\/#website"},"datePublished":"2026-09-17T02:39:09+00:00","dateModified":"2026-10-05T22:02:30+00:00","author":{"@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0"},"description":"A measured breakdown of MySQL memory on a 1 GB VPS: how to read the buffer pool allocation, compute the per-connection worst case, and budget RAM without triggering swap.","breadcrumb":{"@id":"https:\/\/virtualserversvps.com\/blog\/mysql-memory-budget-1gb-vps-tuning\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtualserversvps.com\/blog\/mysql-memory-budget-1gb-vps-tuning\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/virtualserversvps.com\/blog\/mysql-memory-budget-1gb-vps-tuning\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtualserversvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"MySQL Memory Budget on a 1 GB VPS: Measuring Every Buffer Instead of Guessing"}]},{"@type":"WebSite","@id":"https:\/\/virtualserversvps.com\/blog\/#website","url":"https:\/\/virtualserversvps.com\/blog\/","name":"Virtual Servers VPS Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/virtualserversvps.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0","name":"Virtual-Servers-Vps-Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g","caption":"Virtual-Servers-Vps-Editor"},"sameAs":["https:\/\/virtualserversvps.com\/blog"],"url":"https:\/\/virtualserversvps.com\/blog\/author\/virtualserversvps\/"}]}},"_links":{"self":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/1152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/comments?post=1152"}],"version-history":[{"count":3,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/1152\/revisions"}],"predecessor-version":[{"id":1304,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/1152\/revisions\/1304"}],"wp:attachment":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/media?parent=1152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/categories?post=1152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/tags?post=1152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}