{"id":1787,"date":"2026-11-20T02:37:12","date_gmt":"2026-11-20T02:37:12","guid":{"rendered":"https:\/\/virtualserversvps.com\/blog\/?p=1787"},"modified":"2026-11-20T02:37:12","modified_gmt":"2026-11-20T02:37:12","slug":"vps-nvme-write-amplification-fio-tests","status":"publish","type":"post","link":"https:\/\/virtualserversvps.com\/blog\/vps-nvme-write-amplification-fio-tests\/","title":{"rendered":"Measuring NVMe Write Amplification on a VPS with fio"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">SSDs write in 4 KiB pages but erase in 256 KiB to 4 MiB blocks. When a block must be rewritten, the controller copies still-valid pages into a fresh block before erasing the old one. That copy traffic is write amplification, and on a VPS it is largely invisible: the guest sees 4 KiB logical writes while the device underneath performs far more. This article shows how to quantify the gap with <code>fio<\/code> and SMART counters, and which workload patterns drive it up.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The metrics that matter<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Write amplification factor (WAF) is host-side bytes written divided by guest-side bytes written. A WAF of 1.0 means perfect mapping; 3.0 means three times the physical wear for the same application traffic. On a VPS you have two ways to observe it: vendor SMART attributes exposed through a paravirtual interface, and latency\/IOPS divergence between sequential and random workloads.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Most enterprise NVMe drives report <code>Data Units Written<\/code> (SMART attribute 241 or the NVMe log page) as a 512,000-byte-unit count from power-on. Sample it before and after a fixed test run and you get host-side bytes directly. Some virtualized drivers do not pass this through; in that case you fall back on the divergence method described below.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Checking what the guest can see<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Start with identification. <code>nvme list<\/code> shows model, namespace size and the driver in use. If the device appears as <code>\/dev\/sda<\/code> with a virtio-blk driver rather than <code>nvme0n1<\/code>, SMART passthrough is usually unavailable and you should rely on the divergence method.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo nvme list\nNode        SN          Model               Namespace  Usage\n\/dev\/nvme0n1 S4EWNX0M\u2026   Samsung PM9A3       1          39.06 GB\n\n$ sudo smartctl -a \/dev\/nvme0n1 | grep -E 'Data Units Written|Percentage Used|Power On'\nData Units Written:     1,284,236 [657 TB]\nPercentage Used:        3%\nPower On Hours:         4,211\n\n$ cat \/sys\/block\/nvme0n1\/queue\/scheduler\nnone<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Record the <code>Data Units Written<\/code> value (multiply by 512,000 for bytes) and <code>Percentage Used<\/code> before the test. If the drive reports <code>Percentage Used<\/code> at 0% after months of heavy use, passthrough is likely broken and the counter is not trustworthy.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Choosing the fio workload<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Write amplification is driven by small random writes and by filesystem allocation patterns, so a plain sequential test will not reveal it. Run three workloads against the same file: 4 KiB random writes, 128 KiB random writes, and a mixed 70\/30 read\/write at 4 KiB. Disable the filesystem page cache in the job so measurements reflect the device, and use <code>--direct=1<\/code> with an aligned block size.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># 5 GB test file, pre-created so allocation is not part of the run\n$ fio --name=prep --filename=\/data\/fiotest --size=5G \\\n    --rw=write --bs=1M --direct=1 --create_on_open=1 --runtime=1 --time_based\n\n$ fio --name=rand4k --filename=\/data\/fiotest --size=5G \\\n    --rw=randwrite --bs=4k --iodepth=32 --numjobs=1 \\\n    --direct=1 --fdatasync=1 --runtime=300 --time_based \\\n    --group_reporting --output-format=json --output=\/tmp\/rand4k.json<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>--fdatasync=1<\/code> forces a flush every write, which is what a database does. Without it, the test saturates the drive&#8217;s write cache and the numbers flatter the device. Keep runtime fixed at 300 s per workload so the three results are comparable, and run each twice to see the variance before drawing conclusions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Reading the results<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The JSON output carries everything needed: <code>write.iops<\/code>, <code>write.bw_bytes<\/code>, and per-latency percentiles. The ratio between sequential 128 KiB bandwidth and random 4 KiB bandwidth scaled to the same byte volume is the practical signal. A drive that sustains 900 MB\/s sequential but only 42 MB\/s at 4 KiB random is doing roughly 20x the internal work per delivered byte.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ jq -r '.jobs[0].write | \"iops=\\(.iops) bw_MB=\\(.bw_bytes\/1048576|floor) p99_us=\\(.clat_ns.percentile[\"99.000000\"]\/1000|floor)\"' \\\n    \/tmp\/rand4k.json\niops=10752 bw_MB=42 p99_us=1841\n\n$ sudo smartctl -A \/dev\/nvme0n1 | grep 'Data Units Written'\nData Units Written:     1,285,091 [658 TB]\n\n# host-side delta over a 300 s run that wrote 12.6 GB from the guest\n# 855 units * 512000 = 437,760,000 bytes  -&gt; sample is too coarse; use a longer run<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That last point is important: on this drive one counter unit is 512 KB, so a five-minute test moves the counter by less than a thousand units. Run for at least an hour, or write 50 GB or more, before computing WAF from SMART. Anything shorter is dominated by rounding.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What raises write amplification on a VPS<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Overprovisioning is the dominant control. If the namespace occupies the whole raw device with no spare area, the controller has nowhere to place fresh blocks and must erase-and-copy eagerly. Hosts that thin-provision and leave 7\u201328% unallocated see materially lower WAF. You cannot change this from inside the guest, but you can ask your provider, and you can check <code>Percentage Used<\/code> growth as a proxy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Filesystem choices matter next. A filesystem with copy-on-write semantics and frequent snapshots multiplies writes; ext4 with <code>data=ordered<\/code> is the low-amplification baseline. Record sizes above the device&#8217;s physical sector size, aligned partitions, and disabling atime all reduce the number of partial-page writes the controller has to merge.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Mitigations inside the guest<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Batch small writes where the application allows it. Database engines already do this with their redo log; application-level logging that fsyncs on every line does not. Set <code>noatime<\/code>, align partitions to 1 MiB, and avoid swap on NVMe unless you have measured the latency \u2014 swap turns random read traffic into random write traffic, which is the worst case for amplification.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Enable <code>TRIM<\/code> where the provider supports discard. <code>fstrim -av<\/code> run weekly from a timer tells the controller which blocks are free, which directly reduces copy work during garbage collection. If <code>fstrim<\/code> returns errors, the virtual block layer is not passing discard through and the drive will degrade faster than its rated endurance suggests.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo systemctl enable --now fstrim.timer\n$ sudo fstrim -av\n\/data: 34.2 GiB (36708159488 bytes) trimmed on \/dev\/nvme0n1p1\n\n# verify discard support\n$ lsblk -D \/dev\/nvme0n1\nNAME    DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO\nnvme0n1        0      512B       2G         0<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Turning the measurement into a monitoring habit<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Track <code>Percentage Used<\/code> and <code>Data Units Written<\/code> on a weekly scrape alongside your usual host metrics. A drive climbing more than 2% per month on a workload you consider light is a signal to investigate: either a log file is fsyncing far more than expected, or the host is not overprovisioning and wear rates are inflated for everyone on it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are choosing a plan, ask what the storage tier actually is. Our <a href=\"https:\/\/virtualserversvps.com\/blog\/vps-nvme-iops-benchmark-methodology\/\">NVMe IOPS benchmark methodology<\/a> covers the test sequence for comparing drives on paper, and <a href=\"https:\/\/virtualserversvps.com\/\">our VPS plans<\/a> list the storage type and provisioning per tier so the endurance question can be answered before you buy rather than six months in.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>SSDs write in 4 KiB pages but erase in 256 KiB to 4 MiB blocks. When a block must be rewritten, the controller copies still-valid pages into a fresh block&#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":[1],"tags":[],"class_list":["post-1787","post","type-post","status-publish","format-standard","hentry","category-vps-guides-tutorials"],"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>Measuring NVMe Write Amplification on a VPS with fio - Virtual Servers VPS Blog<\/title>\n<meta name=\"description\" content=\"SSDs write in 4 KiB pages but erase in 256 KiB to 4 MiB blocks. When a block must be rewritten, the controller copies still-valid pages into a fresh block\" \/>\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-nvme-write-amplification-fio-tests\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Measuring NVMe Write Amplification on a VPS with fio\" \/>\n<meta property=\"og:description\" content=\"Measuring NVMe Write Amplification on a VPS with fio\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtualserversvps.com\/blog\/vps-nvme-write-amplification-fio-tests\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual Servers VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-20T02:37:12+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=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/vps-nvme-write-amplification-fio-tests\/\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/vps-nvme-write-amplification-fio-tests\/\",\"name\":\"Measuring NVMe Write Amplification on a VPS with fio - Virtual Servers VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\"},\"datePublished\":\"2026-11-20T02:37:12+00:00\",\"author\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\"},\"description\":\"SSDs write in 4 KiB pages but erase in 256 KiB to 4 MiB blocks. When a block must be rewritten, the controller copies still-valid pages into a fresh block\",\"breadcrumb\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/vps-nvme-write-amplification-fio-tests\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtualserversvps.com\/blog\/vps-nvme-write-amplification-fio-tests\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/vps-nvme-write-amplification-fio-tests\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtualserversvps.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Measuring NVMe Write Amplification on a VPS with fio\"}]},{\"@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":"Measuring NVMe Write Amplification on a VPS with fio - Virtual Servers VPS Blog","description":"SSDs write in 4 KiB pages but erase in 256 KiB to 4 MiB blocks. When a block must be rewritten, the controller copies still-valid pages into a fresh block","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-nvme-write-amplification-fio-tests\/","og_locale":"en_US","og_type":"article","og_title":"Measuring NVMe Write Amplification on a VPS with fio","og_description":"Measuring NVMe Write Amplification on a VPS with fio","og_url":"https:\/\/virtualserversvps.com\/blog\/vps-nvme-write-amplification-fio-tests\/","og_site_name":"Virtual Servers VPS Blog","article_published_time":"2026-11-20T02:37:12+00:00","author":"Virtual-Servers-Vps-Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Virtual-Servers-Vps-Editor","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/virtualserversvps.com\/blog\/vps-nvme-write-amplification-fio-tests\/","url":"https:\/\/virtualserversvps.com\/blog\/vps-nvme-write-amplification-fio-tests\/","name":"Measuring NVMe Write Amplification on a VPS with fio - Virtual Servers VPS Blog","isPartOf":{"@id":"https:\/\/virtualserversvps.com\/blog\/#website"},"datePublished":"2026-11-20T02:37:12+00:00","author":{"@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0"},"description":"SSDs write in 4 KiB pages but erase in 256 KiB to 4 MiB blocks. When a block must be rewritten, the controller copies still-valid pages into a fresh block","breadcrumb":{"@id":"https:\/\/virtualserversvps.com\/blog\/vps-nvme-write-amplification-fio-tests\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtualserversvps.com\/blog\/vps-nvme-write-amplification-fio-tests\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/virtualserversvps.com\/blog\/vps-nvme-write-amplification-fio-tests\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtualserversvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Measuring NVMe Write Amplification on a VPS with fio"}]},{"@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\/1787","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=1787"}],"version-history":[{"count":1,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/1787\/revisions"}],"predecessor-version":[{"id":1790,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/1787\/revisions\/1790"}],"wp:attachment":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/media?parent=1787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/categories?post=1787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/tags?post=1787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}