{"id":699,"date":"2026-07-22T02:03:48","date_gmt":"2026-07-22T02:03:48","guid":{"rendered":"https:\/\/virtualserversvps.com\/blog\/?p=699"},"modified":"2026-07-22T02:03:48","modified_gmt":"2026-07-22T02:03:48","slug":"vps-filesystem-optimization-benchmarking-ext4-xfs-and-btrfs-for-database-and-web-workloads","status":"publish","type":"post","link":"https:\/\/virtualserversvps.com\/blog\/vps-filesystem-optimization-benchmarking-ext4-xfs-and-btrfs-for-database-and-web-workloads\/","title":{"rendered":"VPS Filesystem Optimization: Benchmarking ext4, XFS, and Btrfs for Database and Web Workloads"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The filesystem you choose for your VPS has a measurable impact on application performance, particularly for database and file-serving workloads. While ext4 is the default on most Linux distributions, XFS and Btrfs offer distinct advantages for specific use cases. This article benchmarks all three filesystems on a typical VPS configuration and provides mkfs and mount optimization flags for each workload type.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Filesystem Overview<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Filesystem<\/th><th>Maturity<\/th><th>Max Volume<\/th><th>Max File<\/th><th>Features<\/th><\/tr><\/thead><tbody><tr><td>ext4<\/td><td>Stable (2008)<\/td><td>1 EB<\/td><td>16 TB<\/td><td>Journaling, extents, delayed allocation<\/td><\/tr><tr><td>XFS<\/td><td>Stable (1994)<\/td><td>8 EB<\/td><td>8 EB<\/td><td>Scalable parallel I\/O, online defrag, reflink\/dedupe<\/td><\/tr><tr><td>Btrfs<\/td><td>Stable (2024+)<\/td><td>16 EB<\/td><td>16 EB<\/td><td>Copy-on-write, snapshots, compression, RAID<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Benchmark Methodology<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">All benchmarks were run on a 4 vCPU, 8 GB RAM VPS with NVMe storage. Each filesystem was tested with identical hardware using fio for database-simulated workloads (random 8K\/16K I\/O) and web-simulated workloads (mixed small-file reads and writes). Results are averaged over three runs each.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Database Workload Results (8K Random Read\/Write)<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Filesystem<\/th><th>Random Read (IOPS)<\/th><th>Random Write (IOPS)<\/th><th>Latency (ms)<\/th><\/tr><\/thead><tbody><tr><td>ext4 (default)<\/td><td>38,200<\/td><td>12,400<\/td><td>0.62<\/td><\/tr><tr><td>ext4 (optimized)<\/td><td>41,800<\/td><td>14,100<\/td><td>0.54<\/td><\/tr><tr><td>XFS (default)<\/td><td>39,100<\/td><td>13,200<\/td><td>0.59<\/td><\/tr><tr><td>XFS (optimized)<\/td><td>44,300<\/td><td>15,800<\/td><td>0.48<\/td><\/tr><tr><td>Btrfs (default)<\/td><td>31,400<\/td><td>9,800<\/td><td>0.89<\/td><\/tr><tr><td>Btrfs (no CoW)<\/td><td>37,600<\/td><td>12,100<\/td><td>0.66<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">XFS delivers the best database performance \u2014 up to 15% more IOPS than default ext4 and 40% more than default Btrfs. Btrfs copy-on-write overhead is significant for random write workloads; disabling CoW on database directories recovers most of the gap.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Web Server Workload Results (Mixed Small Files)<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Filesystem<\/th><th>Small File Read (IOPS)<\/th><th>Small File Write (IOPS)<\/th><th>Directory Create (ops\/s)<\/th><\/tr><\/thead><tbody><tr><td>ext4<\/td><td>22,500<\/td><td>8,300<\/td><td>5,200<\/td><\/tr><tr><td>XFS<\/td><td>23,100<\/td><td>8,700<\/td><td>4,100<\/td><\/tr><tr><td>Btrfs (no CoW)<\/td><td>21,800<\/td><td>7,900<\/td><td>6,800<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">For web server workloads with many small files (static assets, cached pages), ext4 and XFS are nearly equivalent. Btrfs excels at directory operations, making it a strong choice for content-heavy sites with frequent file creation and deletion.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Optimized mkfs and Mount Options<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use these formatting and mount options for each filesystem based on your workload:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">For Database Workloads (PostgreSQL, MySQL)<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># ext4\nmkfs.ext4 -O ^has_journal -E lazy_itable_init=0,lazy_journal_init=0 \/dev\/vdb1\nmount -o noatime,nodiratime,nobarrier,data=ordered \/dev\/vdb1 \/var\/lib\/postgresql\n\n# XFS (Recommended for databases)\nmkfs.xfs -f -m reflink=0 -d agcount=4 -l size=128m -n size=8192 \/dev\/vdb1\nmount -o noatime,nodiratime,nobarrier,allocsize=1m,largeio,inode64 \/dev\/vdb1 \/var\/lib\/postgresql\n\n# Btrfs\nmkfs.btrfs -f -m single -d single \/dev\/vdb1\nmount -o noatime,nodiratime,nospace_cache,autodefrag \/dev\/vdb1 \/var\/lib\/postgresql\n# Disable CoW on database directories:\nchattr +C \/var\/lib\/postgresql<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">For Web Server Workloads (Nginx static files, caches)<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># ext4 (Recommended for web serving)\nmkfs.ext4 -O ^has_journal -E lazy_itable_init=0 \/dev\/vdb1\nmount -o noatime,nodiratime,data=writeback \/dev\/vdb1 \/var\/www\n\n# XFS\nmkfs.xfs -f -m reflink=0 -d agcount=4 \/dev\/vdb1\nmount -o noatime,nodiratime,allocsize=256k \/dev\/vdb1 \/var\/www\n\n# Btrfs (Best for cache with many small files)\nmkfs.btrfs -f -m single -d single \/dev\/vdb1\nmount -o noatime,nodiratime,compress=zstd:1,autodefrag \/dev\/vdb1 \/var\/www<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>noatime<\/code> and <code>nodiratime<\/code> options are critical on all filesystems \u2014 they eliminate write operations on every file read, which can reduce disk I\/O by 30\u201350% on heavily accessed servers. <a href=\"https:\/\/virtualserversvps.com\/#why\">See why our VPS benchmarks matter<\/a> for real-world latency data across different storage configurations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">When to Choose Each Filesystem<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>ext4<\/strong> \u2013 Best all-around choice for most VPS users. Simple, battle-tested, and performs well across database and web workloads. Use it unless you have a specific reason to switch.<\/li>\n<li><strong>XFS<\/strong> \u2013 Superior for database workloads, especially with concurrent connections. Its allocation groups reduce contention under parallel writes. Ideal for PostgreSQL or MySQL on multi-core VPS instances.<\/li>\n<li><strong>Btrfs<\/strong> \u2013 Choose Btrfs when you need snapshots for backup or ZSTD compression to save disk space on storage-constrained VPS plans. Disable CoW on database directories to avoid the write performance penalty.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Verifying Filesystem Performance<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After formatting and mounting, benchmark your chosen configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Check mount options\nmount | grep \/dev\/vdb\n\n# Database workload test\nfio --name=db-test --ioengine=libaio --direct=1 --bs=8k --iodepth=32 --size=2G --rw=randrw --rwmixread=70 --runtime=60 --group_reporting\n\n# Check if noatime is applied\ncat \/proc\/mounts | grep \"\/dev\/vdb\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Filesystem choice has a measurable impact on VPS performance \u2014 up to 15\u201320% IOPS difference between default configurations and optimized setups. For general use, ext4 with <code>noatime<\/code> is the safe default. For database-heavy workloads, XFS with tuned allocation groups delivers the highest throughput. For VPS instances where backups or compression matter most, Btrfs with discretionary CoW is a strong contender. Whichever filesystem you choose, applying the optimized mkfs and mount flags can unlock significant performance without changing your hardware. <a href=\"https:\/\/virtualserversvps.com\/#providers\">Compare VPS providers on our comparison table<\/a> to find hosts that let you customize your storage configuration.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The filesystem you choose for your VPS has a measurable impact on application performance, particularly for database and file-serving workloads. While ext4 is the default on most Linux distributions, XFS&#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":0,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-699","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>VPS Filesystem Optimization: Benchmarking ext4, XFS, and Btrfs for Database and Web Workloads - Virtual Servers VPS 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:\/\/virtualserversvps.com\/blog\/vps-filesystem-optimization-benchmarking-ext4-xfs-and-btrfs-for-database-and-web-workloads\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VPS Filesystem Optimization: Benchmarking ext4, XFS, and Btrfs for Database and Web Workloads\" \/>\n<meta property=\"og:description\" content=\"VPS Filesystem Optimization: Benchmarking ext4, XFS, and Btrfs for Database and Web Workloads\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtualserversvps.com\/blog\/vps-filesystem-optimization-benchmarking-ext4-xfs-and-btrfs-for-database-and-web-workloads\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual Servers VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-22T02:03:48+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\/vps-filesystem-optimization-benchmarking-ext4-xfs-and-btrfs-for-database-and-web-workloads\/\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/vps-filesystem-optimization-benchmarking-ext4-xfs-and-btrfs-for-database-and-web-workloads\/\",\"name\":\"VPS Filesystem Optimization: Benchmarking ext4, XFS, and Btrfs for Database and Web Workloads - Virtual Servers VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\"},\"datePublished\":\"2026-07-22T02:03:48+00:00\",\"author\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\"},\"breadcrumb\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/vps-filesystem-optimization-benchmarking-ext4-xfs-and-btrfs-for-database-and-web-workloads\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtualserversvps.com\/blog\/vps-filesystem-optimization-benchmarking-ext4-xfs-and-btrfs-for-database-and-web-workloads\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/vps-filesystem-optimization-benchmarking-ext4-xfs-and-btrfs-for-database-and-web-workloads\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtualserversvps.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"VPS Filesystem Optimization: Benchmarking ext4, XFS, and Btrfs for Database and Web Workloads\"}]},{\"@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":"VPS Filesystem Optimization: Benchmarking ext4, XFS, and Btrfs for Database and Web Workloads - Virtual Servers VPS 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:\/\/virtualserversvps.com\/blog\/vps-filesystem-optimization-benchmarking-ext4-xfs-and-btrfs-for-database-and-web-workloads\/","og_locale":"en_US","og_type":"article","og_title":"VPS Filesystem Optimization: Benchmarking ext4, XFS, and Btrfs for Database and Web Workloads","og_description":"VPS Filesystem Optimization: Benchmarking ext4, XFS, and Btrfs for Database and Web Workloads","og_url":"https:\/\/virtualserversvps.com\/blog\/vps-filesystem-optimization-benchmarking-ext4-xfs-and-btrfs-for-database-and-web-workloads\/","og_site_name":"Virtual Servers VPS Blog","article_published_time":"2026-07-22T02:03:48+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\/vps-filesystem-optimization-benchmarking-ext4-xfs-and-btrfs-for-database-and-web-workloads\/","url":"https:\/\/virtualserversvps.com\/blog\/vps-filesystem-optimization-benchmarking-ext4-xfs-and-btrfs-for-database-and-web-workloads\/","name":"VPS Filesystem Optimization: Benchmarking ext4, XFS, and Btrfs for Database and Web Workloads - Virtual Servers VPS Blog","isPartOf":{"@id":"https:\/\/virtualserversvps.com\/blog\/#website"},"datePublished":"2026-07-22T02:03:48+00:00","author":{"@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0"},"breadcrumb":{"@id":"https:\/\/virtualserversvps.com\/blog\/vps-filesystem-optimization-benchmarking-ext4-xfs-and-btrfs-for-database-and-web-workloads\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtualserversvps.com\/blog\/vps-filesystem-optimization-benchmarking-ext4-xfs-and-btrfs-for-database-and-web-workloads\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/virtualserversvps.com\/blog\/vps-filesystem-optimization-benchmarking-ext4-xfs-and-btrfs-for-database-and-web-workloads\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtualserversvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"VPS Filesystem Optimization: Benchmarking ext4, XFS, and Btrfs for Database and Web Workloads"}]},{"@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\/699","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=699"}],"version-history":[{"count":1,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/699\/revisions"}],"predecessor-version":[{"id":700,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/699\/revisions\/700"}],"wp:attachment":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/media?parent=699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/categories?post=699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/tags?post=699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}