{"id":1185,"date":"2026-09-15T07:39:29","date_gmt":"2026-09-15T07:39:29","guid":{"rendered":"https:\/\/affordablevpsserver.com\/blog\/?p=1185"},"modified":"2026-09-15T07:39:29","modified_gmt":"2026-09-15T07:39:29","slug":"vps-ram-headroom-how-much-spare-memory-to-keep","status":"publish","type":"post","link":"https:\/\/affordablevpsserver.com\/blog\/vps-ram-headroom-how-much-spare-memory-to-keep\/","title":{"rendered":"RAM Headroom on a VPS: How Much Spare Memory You Should Actually Keep"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A VPS running at 95% memory utilization is not efficient &#8212; it is one traffic spike away from thrashing. Linux reports &#8220;available&#8221; memory separately from &#8220;free&#8221; memory precisely because page cache is reclaimable and application allocations are not. The number to watch is available memory, and the headroom you should keep depends on how fast your workload can grow.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Workload type<\/th><th>Burst multiplier<\/th><th>Target headroom<\/th><th>On a 2 GB plan, keep free<\/th><\/tr><\/thead><tbody><tr><td>Static site behind a CDN<\/td><td>1.2&#215;<\/td><td>20%<\/td><td>400 MB<\/td><\/tr><tr><td>WordPress with page cache<\/td><td>1.5&#8211;2&#215;<\/td><td>35%<\/td><td>700 MB<\/td><\/tr><tr><td>WordPress without cache<\/td><td>2&#8211;3&#215;<\/td><td>40%<\/td><td>800 MB<\/td><\/tr><tr><td>Custom app with uncached queries<\/td><td>3&#215;+<\/td><td>50%<\/td><td>1 GB<\/td><\/tr><tr><td>Database server<\/td><td>1.3&#215;<\/td><td>25%<\/td><td>500 MB<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Read the Right Column<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>free -m<\/code> shows a <em>free<\/em> column that is usually near zero on a healthy server, because Linux uses spare RAM for page cache. That is not a problem. The column that matters is <em>available<\/em>, which discounts reclaimable cache and estimates what a new application allocation could get without swapping.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>free -m\n#               total        used        free      shared  buff\/cache   available\n# Mem:           1987         842          91           8        1054         986\n#\n# 986 MB available, 1054 MB in reclaimable cache -&gt; healthy.\n\n# Look at it as a percentage\nfree -m | awk 'NR==2{printf \"%.1f%% available\\n\", $7\/$2*100}'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">As a rule of thumb, treat under 15% available as a warning and under 8% as an active incident. Below 8%, the kernel starts reclaiming aggressively, then swapping, and swap on a budget plan is typically slow shared storage &#8212; latency jumps before you see an out-of-memory kill.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Two Metrics That Predict Trouble<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Absolute headroom tells you where you are. These two tell you where you are going:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Swap in\/out rate (<code>vmstat<\/code> columns <code>si<\/code>\/<code>so<\/code>):<\/strong> any sustained non-zero value means the working set no longer fits. Intermittent single-digit KB pages are normal noise; sustained hundreds of KB\/s is not.<\/li><li><strong>Page-scan rate (<code>sar -B<\/code> <code>pgscan<\/code>):<\/strong> rising scans with flat application memory means the kernel is hunting for free pages. That is the last warning before swap.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>vmstat 5 12 | awk 'NR&gt;2{print \"avail-ish used:\",$4\" si:\",$7\" so:\",$8}'\n\n# Which process is actually growing\nps -eo rss,comm --sort=-rss | head -8\n\n# Per-process growth over 60s\nfor i in 1 2 3; do ps -eo rss,comm --sort=-rss | head -4; sleep 20; done<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Where Headroom Disappears<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Cause<\/th><th>Symptom<\/th><th>Fix<\/th><\/tr><\/thead><tbody><tr><td>PHP-FPM pool sized too large<\/td><td>Many idle workers, each holding 40&#8211;60 MB<\/td><td>Cut <code>pm.max_children<\/code> to fit measured concurrency<\/td><\/tr><tr><td>MySQL buffer pool too generous<\/td><td>Database RSS grows to the configured cap<\/td><td>Set <code>innodb_buffer_pool_size<\/code> to ~50% of RAM on a shared box<\/td><\/tr><tr><td>Docker image layer cache<\/td><td>Slow, steady growth after each deploy<\/td><td>Prune images on a schedule<\/td><\/tr><tr><td>Unbounded log buffers with journald<\/td><td>Growth after incidents<\/td><td>Set <code>SystemMaxUse<\/code><\/td><\/tr><tr><td>Memory leak in an app worker<\/td><td>RSS climbs monotonically over days<\/td><td>Restart worker on a timer, then fix the leak<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If two or more of these stack up, no amount of tuning recovers the headroom. That is the point where the RAM tier itself is the problem. Our <a href=\"https:\/\/affordablevpsserver.com\/\">VPS plan comparison table<\/a> shows what each successive RAM tier costs per month, which makes the &#8220;tune vs. upgrade&#8221; decision a straight arithmetic comparison rather than a guess.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Right-Sizing the Two Processes That Eat Headroom<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">On a typical budget VPS, PHP-FPM and MySQL account for most of the working set, and both ship with defaults that assume more RAM than you have. The failure mode is not a crash &#8212; it is a slow bleed of available memory as workers accumulate.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Surface<\/th><th>Common default<\/th><th>Budget-safe setting<\/th><th>Headroom recovered<\/th><\/tr><\/thead><tbody><tr><td>PHP-FPM <code>pm.max_children<\/code><\/td><td>25 on a 2 GB box<\/td><td>8&#8211;10 (measured concurrency)<\/td><td>600&#8211;900 MB<\/td><\/tr><tr><td>MySQL <code>innodb_buffer_pool_size<\/code><\/td><td>128 MB (too small) or 70% of RAM (too large)<\/td><td>40&#8211;50% of installed RAM<\/td><td>200&#8211;400 MB<\/td><\/tr><tr><td>Redis <code>maxmemory<\/code><\/td><td>unbounded<\/td><td>memory limit + <code>allkeys-lru<\/code><\/td><td>prevents unbounded growth<\/td><\/tr><tr><td>journald <code>SystemMaxUse<\/code><\/td><td>10% of filesystem<\/td><td>200&#8211;400 MB<\/td><td>disk, plus predictable logs<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Note the asymmetry in the MySQL row. Setting the buffer pool too small causes steady disk reads and higher latency; setting it too large removes the headroom that the web tier needs during bursts. On a single 2 GB server running both, 512 MB is a reliable compromise. On a 4 GB server that also runs the web tier, 1.5&#8211;2 GB is comfortable.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># How much memory PHP-FPM is really holding\nps -eo rss,cmd | grep 'php-fpm: pool' | awk '{s+=$1; n++} END{printf \"%d workers, %.0f MB total, %.0f MB each\\n\", n, s\/1024, s\/1024\/n}'\n\n# MySQL resident size vs configured pool\nps -o rss= -C mysqld | awk '{printf \"mysqld RSS: %.0f MB\\n\", $1\/1024}'\nmysql -e \"SHOW VARIABLES LIKE 'innodb_buffer_pool_size';\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run this under peak load, not at 3 AM. If PHP-FPM workers total more than 40% of installed RAM, the pool is over-provisioned regardless of what setting is in the config file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Set a Headroom Alarm<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Alert on available memory, not on usage, and alert on the trend rather than the instantaneous value. A useful threshold set:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Warning:<\/strong> available drops below 20% for more than 10 minutes<\/li><li><strong>Critical:<\/strong> available below 10%, or any sustained <code>so<\/code> above 100 KB\/s<\/li><li><strong>Trend:<\/strong> 7-day peak available memory declines more than 25% week over week<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Free tooling covers all three; our list of <a href=\"https:\/\/affordablevpsserver.com\/\">free monitoring tools for budget VPS servers<\/a> includes the ones that graph available memory without a paid agent.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When you do upgrade, buy the next tier up rather than the next tier that exactly fits &#8212; headroom is the product you are actually paying for. InterServer holds pricing flat across the term so the upgrade math stays stable: <a href=\"https:\/\/www.interserver.net\/vps?id=1067793\" rel=\"noreferrer noopener sponsored\" target=\"_blank\">view InterServer VPS tiers<\/a>. If you would rather find the exact threshold empirically, <a href=\"https:\/\/www.vultr.com\/?ref=9805352-9J\" rel=\"noreferrer noopener sponsored\" target=\"_blank\">Vultr lets you resize hourly<\/a> and watch the headroom curve move in real time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A VPS running at 95% memory utilization is not efficient &#8212; it is one traffic spike away from thrashing. Linux reports &#8220;available&#8221; memory separately from &#8220;free&#8221; memory precisely because page cache is reclaimable and application allocations are not. The number to watch is available memory, and the headroom you should keep depends on how fast [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":2,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-1185","post","type-post","status-publish","format-standard","hentry","category-budget-vps-guides"],"blocksy_meta":[],"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>RAM Headroom on a VPS: How Much Spare Memory You Should Actually Keep - Affordable VPS Server Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/affordablevpsserver.com\/blog\/vps-ram-headroom-how-much-spare-memory-to-keep\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"RAM Headroom on a VPS: How Much Spare Memory You Should Actually Keep\" \/>\n<meta property=\"og:description\" content=\"RAM Headroom on a VPS: How Much Spare Memory You Should Actually Keep\" \/>\n<meta property=\"og:url\" content=\"https:\/\/affordablevpsserver.com\/blog\/vps-ram-headroom-how-much-spare-memory-to-keep\/\" \/>\n<meta property=\"og:site_name\" content=\"Affordable VPS Server Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-15T07:39:29+00:00\" \/>\n<meta name=\"author\" content=\"Affordable-Vps-Server-Author\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Affordable-Vps-Server-Author\" \/>\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:\/\/affordablevpsserver.com\/blog\/vps-ram-headroom-how-much-spare-memory-to-keep\/\",\"url\":\"https:\/\/affordablevpsserver.com\/blog\/vps-ram-headroom-how-much-spare-memory-to-keep\/\",\"name\":\"RAM Headroom on a VPS: How Much Spare Memory You Should Actually Keep - Affordable VPS Server Blog\",\"isPartOf\":{\"@id\":\"https:\/\/affordablevpsserver.com\/blog\/#website\"},\"datePublished\":\"2026-09-15T07:39:29+00:00\",\"author\":{\"@id\":\"https:\/\/affordablevpsserver.com\/blog\/#\/schema\/person\/685a02c93a3c45030f7427ec928b0df7\"},\"breadcrumb\":{\"@id\":\"https:\/\/affordablevpsserver.com\/blog\/vps-ram-headroom-how-much-spare-memory-to-keep\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/affordablevpsserver.com\/blog\/vps-ram-headroom-how-much-spare-memory-to-keep\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/affordablevpsserver.com\/blog\/vps-ram-headroom-how-much-spare-memory-to-keep\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/affordablevpsserver.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"RAM Headroom on a VPS: How Much Spare Memory You Should Actually Keep\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/affordablevpsserver.com\/blog\/#website\",\"url\":\"https:\/\/affordablevpsserver.com\/blog\/\",\"name\":\"Affordable VPS Server Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/affordablevpsserver.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/affordablevpsserver.com\/blog\/#\/schema\/person\/685a02c93a3c45030f7427ec928b0df7\",\"name\":\"Affordable-Vps-Server-Author\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/affordablevpsserver.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8fa20973a7dd04621d396c26ba26b5c5e6c19595583335121958527393f6f95e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8fa20973a7dd04621d396c26ba26b5c5e6c19595583335121958527393f6f95e?s=96&d=mm&r=g\",\"caption\":\"Affordable-Vps-Server-Author\"},\"sameAs\":[\"https:\/\/affordablevpsserver.com\/blog\"],\"url\":\"https:\/\/affordablevpsserver.com\/blog\/author\/affordablevpsserver\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"RAM Headroom on a VPS: How Much Spare Memory You Should Actually Keep - Affordable VPS Server Blog","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:\/\/affordablevpsserver.com\/blog\/vps-ram-headroom-how-much-spare-memory-to-keep\/","og_locale":"en_US","og_type":"article","og_title":"RAM Headroom on a VPS: How Much Spare Memory You Should Actually Keep","og_description":"RAM Headroom on a VPS: How Much Spare Memory You Should Actually Keep","og_url":"https:\/\/affordablevpsserver.com\/blog\/vps-ram-headroom-how-much-spare-memory-to-keep\/","og_site_name":"Affordable VPS Server Blog","article_published_time":"2026-09-15T07:39:29+00:00","author":"Affordable-Vps-Server-Author","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Affordable-Vps-Server-Author","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/affordablevpsserver.com\/blog\/vps-ram-headroom-how-much-spare-memory-to-keep\/","url":"https:\/\/affordablevpsserver.com\/blog\/vps-ram-headroom-how-much-spare-memory-to-keep\/","name":"RAM Headroom on a VPS: How Much Spare Memory You Should Actually Keep - Affordable VPS Server Blog","isPartOf":{"@id":"https:\/\/affordablevpsserver.com\/blog\/#website"},"datePublished":"2026-09-15T07:39:29+00:00","author":{"@id":"https:\/\/affordablevpsserver.com\/blog\/#\/schema\/person\/685a02c93a3c45030f7427ec928b0df7"},"breadcrumb":{"@id":"https:\/\/affordablevpsserver.com\/blog\/vps-ram-headroom-how-much-spare-memory-to-keep\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/affordablevpsserver.com\/blog\/vps-ram-headroom-how-much-spare-memory-to-keep\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/affordablevpsserver.com\/blog\/vps-ram-headroom-how-much-spare-memory-to-keep\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/affordablevpsserver.com\/blog\/"},{"@type":"ListItem","position":2,"name":"RAM Headroom on a VPS: How Much Spare Memory You Should Actually Keep"}]},{"@type":"WebSite","@id":"https:\/\/affordablevpsserver.com\/blog\/#website","url":"https:\/\/affordablevpsserver.com\/blog\/","name":"Affordable VPS Server Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/affordablevpsserver.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/affordablevpsserver.com\/blog\/#\/schema\/person\/685a02c93a3c45030f7427ec928b0df7","name":"Affordable-Vps-Server-Author","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/affordablevpsserver.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8fa20973a7dd04621d396c26ba26b5c5e6c19595583335121958527393f6f95e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8fa20973a7dd04621d396c26ba26b5c5e6c19595583335121958527393f6f95e?s=96&d=mm&r=g","caption":"Affordable-Vps-Server-Author"},"sameAs":["https:\/\/affordablevpsserver.com\/blog"],"url":"https:\/\/affordablevpsserver.com\/blog\/author\/affordablevpsserver\/"}]}},"_links":{"self":[{"href":"https:\/\/affordablevpsserver.com\/blog\/wp-json\/wp\/v2\/posts\/1185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/affordablevpsserver.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/affordablevpsserver.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/affordablevpsserver.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/affordablevpsserver.com\/blog\/wp-json\/wp\/v2\/comments?post=1185"}],"version-history":[{"count":1,"href":"https:\/\/affordablevpsserver.com\/blog\/wp-json\/wp\/v2\/posts\/1185\/revisions"}],"predecessor-version":[{"id":1188,"href":"https:\/\/affordablevpsserver.com\/blog\/wp-json\/wp\/v2\/posts\/1185\/revisions\/1188"}],"wp:attachment":[{"href":"https:\/\/affordablevpsserver.com\/blog\/wp-json\/wp\/v2\/media?parent=1185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affordablevpsserver.com\/blog\/wp-json\/wp\/v2\/categories?post=1185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affordablevpsserver.com\/blog\/wp-json\/wp\/v2\/tags?post=1185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}