{"id":1331,"date":"2026-10-07T23:58:07","date_gmt":"2026-10-07T23:58:07","guid":{"rendered":"https:\/\/virtualserversvps.com\/blog\/?p=1331"},"modified":"2026-10-07T23:58:07","modified_gmt":"2026-10-07T23:58:07","slug":"auditing-systemd-journal-disk-usage-small-vps","status":"publish","type":"post","link":"https:\/\/virtualserversvps.com\/blog\/auditing-systemd-journal-disk-usage-small-vps\/","title":{"rendered":"Auditing systemd Journal Disk Usage on a Small VPS: Measure, Cap and Verify"},"content":{"rendered":"<div style=\"padding:20px\">\n\n\n<p class=\"wp-block-paragraph\">On a small VPS with a 20\u201340 GB disk, an unmanaged systemd journal is one of the most common causes of a surprise full filesystem. Unlike logrotate-driven text logs, the journal is a binary store with its own retention logic, and its size is not obvious from <code>du<\/code> on <code>\/var\/log<\/code> until you know where to look. This is a measurement-first audit: find out what the journal actually holds, how fast it grows, then cap it deliberately.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Measure Before You Cap Anything<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>journalctl<\/code> reports its own disk usage directly, which is more reliable than guessing from directory sizes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl --disk-usage\ndu -sh \/var\/log\/journal \/run\/log\/journal 2&gt;\/dev\/null\nls -lh \/var\/log\/journal\/*\/ | head<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Two locations matter. <code>\/run\/log\/journal<\/code> is a tmpfs store that vanishes on reboot; <code>\/var\/log\/journal<\/code> is persistent. If only the former exists, your logs are not surviving reboots at all \u2014 a separate problem worth fixing if you need post-mortem forensics.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Find Who Is Flooding the Journal<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A journal that balloons from a few hundred MB to several GB in a day is usually one misbehaving unit writing in a tight loop. Rank units by volume:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl --since \"24 hours ago\" --output=json \\\n  | jq -r '.SYSLOG_IDENTIFIER \/\/ ._COMM' | sort | uniq -c | sort -rn | head -20<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If <code>jq<\/code> is not installed and you want a lighter view, use <code>journalctl --since \"1 hour ago\" | awk '{print $5}' | sort | uniq -c | sort -rn<\/code>. Either way the goal is to identify the top talker. Common culprits are a failing service crash-looping, an application logging every request at debug level, or a kernel warning repeated thousands of times per minute.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Cap Retention in journald.conf<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">journald offers three independent limits \u2014 size, time, and free-space floor. Set all three; they interact, and whichever triggers first wins.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo tee \/etc\/systemd\/journald.conf.d\/size.conf &lt;&lt;'EOF'\n[Journal]\nSystemMaxUse=500M\nSystemKeepFree=1G\nMaxRetentionSec=2week\nMaxFileSec=1week\nCompress=yes\nStorage=persistent\nEOF\nsudo systemctl restart systemd-journald<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Directive<\/th><th>Purpose<\/th><th>Suggested value<\/th><\/tr><\/thead><tbody><tr><td>SystemMaxUse<\/td><td>Hard ceiling on journal size<\/td><td>500M\u20131G<\/td><\/tr><tr><td>SystemKeepFree<\/td><td>Always leave disk free<\/td><td>1G<\/td><\/tr><tr><td>MaxRetentionSec<\/td><td>Delete entries older than<\/td><td>2week<\/td><\/tr><tr><td>MaxFileSec<\/td><td>Rotate a journal file after<\/td><td>1week<\/td><\/tr><tr><td>Compress<\/td><td>Compress rotated files<\/td><td>yes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><code>SystemKeepFree<\/code> is the safety net: even if a log flood occurs, journald stops before the disk fills and takes your services down with it. On a 20 GB VPS, keeping a 1 GB floor is cheap insurance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Force Rotation and Reclaim Immediately<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Config changes apply to new writes; existing data must be rotated and vacuumed explicitly. Do this in the right order:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo journalctl --rotate\nsudo journalctl --vacuum-size=500M\nsudo journalctl --vacuum-time=2weeks\njournalctl --disk-usage<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>--rotate<\/code> seals the current active file; <code>--vacuum-size<\/code> then deletes oldest entries until the cap is met. Run <code>--disk-usage<\/code> afterward to confirm the reclaim actually happened.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Set Caps Per-Unit, Not Just Globally<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">One chatty unit can still consume the entire global budget and evict everything else. Limit the noisy service at the source with <code>LogRateLimit*<\/code>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add <code>LogRateLimitIntervalSec=30s<\/code> and <code>LogRateLimitBurst=1000<\/code> to the misbehaving unit.<\/li>\n<li>Set <code>MaxLevelStore=warning<\/code> on units that log debug noise you rarely need.<\/li>\n<li>If the volume is genuinely useful, send it to a remote collector instead of keeping it locally.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Automate Verification<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Retention limits are only trustworthy if they hold over time. A weekly check that surfaces journal size alongside overall disk usage catches drift early:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl --disk-usage\ndf -h \/ | awk 'NR==2 {print \"root used:\", $5}'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Wire that into an existing monitoring agent and alert when the journal exceeds, say, 600 MB against a 500 MB cap \u2014 a small overshoot is normal between vacuums, but a growing gap means a limit is not being applied. If disk pressure is a recurring theme on your instance, it is worth reviewing the <a href=\"https:\/\/virtualserversvps.com\/#providers\">comparison of VPS plans<\/a> to see whether a larger volume would cost less than the operational effort of constant cleanup.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Keep the Useful Part, Discard the Rest<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Capping the journal is not the same as losing observability. Most of what fills a journal is routine and can be sent elsewhere or suppressed, while the entries you actually need for debugging an incident are a small fraction. Before capping, decide what is worth keeping: kernel errors, service start and stop events, authentication failures, and OOM messages. What is rarely worth keeping at full fidelity is per-request application logging, which belongs in files managed by logrotate and shipped to an aggregator if it matters.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A useful pattern on a small VPS is to keep local retention short and forward anything important off-box. That way the instance&#8217;s disk stays predictable regardless of what a noisy service does, and you retain long-term history without paying for it in local storage. The journal becomes a rotating buffer for recent events; the remote store becomes the archive.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Audit Summary<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Read <code>journalctl --disk-usage<\/code> for the true size.<\/li>\n<li>Identify the top logging unit.<\/li>\n<li>Set size, free-space, and time caps together.<\/li>\n<li>Rotate and vacuum to apply them now.<\/li>\n<li>Rate-limit noisy units at the source.<\/li>\n<li>Monitor size weekly against the configured cap.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A journal is a diagnostic asset, not a data hoard. Capping it to a size you can afford, and knowing where the flood comes from, means a full disk is never a mystery. Combined with sane <a href=\"https:\/\/virtualserversvps.com\/\">log retention practices across the rest of the system<\/a>, this keeps a small VPS predictable under sustained write load.<\/p>\n\n\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>On a small VPS with a 20\u201340 GB disk, an unmanaged systemd journal is one of the most common causes of a surprise full filesystem. Unlike logrotate-driven text logs, the&#8230;<\/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":[3],"tags":[],"class_list":["post-1331","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>Auditing systemd Journal Disk Usage on a Small VPS: Measure, Cap and Verify - Virtual Servers VPS Blog<\/title>\n<meta name=\"description\" content=\"On a small VPS with a 20\u201340 GB disk, an unmanaged systemd journal is one of the most common causes of a surprise full filesystem. Unlike logrotate-driven\" \/>\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\/auditing-systemd-journal-disk-usage-small-vps\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Auditing systemd Journal Disk Usage on a Small VPS: Measure, Cap and Verify\" \/>\n<meta property=\"og:description\" content=\"Auditing systemd Journal Disk Usage on a Small VPS: Measure, Cap and Verify\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtualserversvps.com\/blog\/auditing-systemd-journal-disk-usage-small-vps\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual Servers VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-07T23:58:07+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\/auditing-systemd-journal-disk-usage-small-vps\/\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/auditing-systemd-journal-disk-usage-small-vps\/\",\"name\":\"Auditing systemd Journal Disk Usage on a Small VPS: Measure, Cap and Verify - Virtual Servers VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\"},\"datePublished\":\"2026-10-07T23:58:07+00:00\",\"author\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\"},\"description\":\"On a small VPS with a 20\u201340 GB disk, an unmanaged systemd journal is one of the most common causes of a surprise full filesystem. Unlike logrotate-driven\",\"breadcrumb\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/auditing-systemd-journal-disk-usage-small-vps\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtualserversvps.com\/blog\/auditing-systemd-journal-disk-usage-small-vps\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/auditing-systemd-journal-disk-usage-small-vps\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtualserversvps.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Auditing systemd Journal Disk Usage on a Small VPS: Measure, Cap and Verify\"}]},{\"@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":"Auditing systemd Journal Disk Usage on a Small VPS: Measure, Cap and Verify - Virtual Servers VPS Blog","description":"On a small VPS with a 20\u201340 GB disk, an unmanaged systemd journal is one of the most common causes of a surprise full filesystem. Unlike logrotate-driven","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\/auditing-systemd-journal-disk-usage-small-vps\/","og_locale":"en_US","og_type":"article","og_title":"Auditing systemd Journal Disk Usage on a Small VPS: Measure, Cap and Verify","og_description":"Auditing systemd Journal Disk Usage on a Small VPS: Measure, Cap and Verify","og_url":"https:\/\/virtualserversvps.com\/blog\/auditing-systemd-journal-disk-usage-small-vps\/","og_site_name":"Virtual Servers VPS Blog","article_published_time":"2026-10-07T23:58:07+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\/auditing-systemd-journal-disk-usage-small-vps\/","url":"https:\/\/virtualserversvps.com\/blog\/auditing-systemd-journal-disk-usage-small-vps\/","name":"Auditing systemd Journal Disk Usage on a Small VPS: Measure, Cap and Verify - Virtual Servers VPS Blog","isPartOf":{"@id":"https:\/\/virtualserversvps.com\/blog\/#website"},"datePublished":"2026-10-07T23:58:07+00:00","author":{"@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0"},"description":"On a small VPS with a 20\u201340 GB disk, an unmanaged systemd journal is one of the most common causes of a surprise full filesystem. Unlike logrotate-driven","breadcrumb":{"@id":"https:\/\/virtualserversvps.com\/blog\/auditing-systemd-journal-disk-usage-small-vps\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtualserversvps.com\/blog\/auditing-systemd-journal-disk-usage-small-vps\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/virtualserversvps.com\/blog\/auditing-systemd-journal-disk-usage-small-vps\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtualserversvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Auditing systemd Journal Disk Usage on a Small VPS: Measure, Cap and Verify"}]},{"@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\/1331","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=1331"}],"version-history":[{"count":1,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/1331\/revisions"}],"predecessor-version":[{"id":1332,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/1331\/revisions\/1332"}],"wp:attachment":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/media?parent=1331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/categories?post=1331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/tags?post=1331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}