01 Sequential or random
Sequential overwrites arrive in the order the data was written, so the oldest block is entirely stale and nothing is copied. Random overwrites scatter live pages through every block, and WAF settles near 2.7 instead of 1.00.
Flash Foundations companion · Simulator
NAND cannot overwrite a page. It can only write a fresh one and, later, erase a whole block. Watch one small drive pay for that rule. Write amplification (WAF) is how much more the drive writes to flash than the host sent it, and it moves with the workload, the spare area, TRIM and data placement.
The walkthrough
Pick a setup, then a variant of it. The drive below restarts with those settings and WAF settles as it runs. Color the map by page state, data temperature or erase count to see why.
Reduced motion is on, so the drive starts paused. Use Step to advance a little at a time, or Run to play.
Sequential overwrites arrive in the order the data was written, so the oldest block is entirely stale and nothing is copied. Random overwrites scatter live pages through every block, and WAF settles near 2.7 instead of 1.00.
Every page is valid, invalid or free.
A what-if sweep is measuring, so the drive is paused. Wait for the sweep, or cancel it.
WAF is the data written to the flash divided by the data the host wrote. At 1.00 the drive writes nothing extra, and at 2.00 garbage collection copies one page for every page the host sends.
The recent window covers the last four drive-fulls of host writes, so it shows where WAF is heading before the cumulative figure catches up. Wear evenness is the mean erase count divided by the highest one.
The bench
Each point is a small drive of its own, simulated from scratch with your current settings and measured in steady state, once it has settled into its routine. Choose one setting to sweep and press Run sweep. The result joins the chart as a line, and up to five lines can sit side by side.
To compare two policies, run the sweep, change the policy in the settings above, and run it again. Pin live drive drops a diamond at the drive you are watching. Click a point to load that exact drive into the map.
The dashed line is the textbook estimate, drawn only for overprovisioning. It assumes a full drive, uniform random writes and greedy collection, so treat it as a reference. This simulator holds a few blocks in reserve, and a drive that is less than full does better than the line.
With uniform random writes, 25% overprovisioning and a full drive, the block size sweep climbs from about 2 at 8 pages to about 6 at 512.
Sweeps overprovisioning from 5% to 50%. A small drive cannot run at the low end, so its run starts higher.
Every other setting is copied from the live drive when you press Run sweep.
No runs yet.
No runs yet. Press Run sweep to measure a line, or Pin live drive to mark the drive you are watching.
Keyboard: Tab to the chart, then Left and Right move along a run, Up and Down switch runs, Home and End jump to the ends, and Enter loads the drive. The vertical range grows to fit the runs on show.
| Run | Setting | WAF | User pages |
|---|---|---|---|
| No visible runs. | |||
The setups, written out
Exact values move a little with the seed, and the direction does not. Each setup starts from the default drive and changes only what is listed.
Sequential overwrites arrive in the order the data was written, so the oldest block is entirely stale and nothing is copied. Random overwrites scatter live pages through every block, and WAF settles near 2.7 instead of 1.00.
Overprovisioning 7%, fullness 85%, Greedy. Compare: Uniform random, Sequential.
Extra spare area gives garbage collection emptier blocks to pick. On a full drive with random writes, WAF falls from about 9 at 7% to about 2.5 at 28% and about 1.7 at 50%.
Uniform random, fullness 100%, Greedy. Compare: 7% spare, 28% spare, 50% spare.
TRIM only matters when the drive is not full. At 70% full it keeps WAF near 1.7, and without it deleted files stay valid, so WAF climbs toward the full-drive figure.
Uniform random, overprovisioning 7%, fullness 70%, Greedy. Compare: TRIM off, TRIM on.
When the drive is told which data is hot, it keeps hot and cold pages in separate blocks. Here that lowers WAF from about 2.4 to about 2.2.
80-20 hot-cold, Cost-benefit, overprovisioning 28%, fullness 100%. Compare: Mixed together, Separated.
Greedy chases the emptiest block and keeps rewriting hot data. Cost-benefit also weighs how long a block has been quiet, and here it gets about 3.9 against about 4.5.
80-20 hot-cold, overprovisioning 15%, fullness 100%, hot and cold data not separated. Compare: Greedy, Cost-benefit.
A drive is worn out when its worst block is, not its average one. After about 12 drive-fulls, raising the wear weight from 0% to 100% lifts wear evenness from about 68% to about 88%.
80-20 hot-cold, overprovisioning 15%, fullness 100%, Greedy. Raise the speed to get there sooner. Compare: Wear weight 0%, Wear weight 100%.
The drive keeps a page-level mapping table: every logical page maps to any physical page. Pages go free, then valid, then invalid, and only a whole block can be erased. The table takes 59.8 KiB on the default drive, at 4 bytes a page. A real drive that maps in 4 KiB units needs about 1 GB of table for every 1 TB, which is why it usually keeps the table in DRAM.
Garbage collection starts when free blocks fall below a small reserve and runs until it is restored. Greedy picks the block with the fewest valid pages. Cost-benefit maximizes (1 − u) / 2u × age, where u is the valid fraction and age is the time since the block closed.
With placement off, every host write shares one stream and garbage-collection relocations use a second. With placement on and the 80-20 workload, hot and cold host data get their own streams and relocations a third, an oracle standing in for FDP or ZNS placement hints. Sequential and uniform workloads carry no hot or cold label, so placement changes nothing for them.
Preconditioning writes every live logical page once, then zeroes the counters, so WAF is measured from a full drive. TRIM matters only below 100% fullness. Random workloads occasionally delete eight live pages and create eight others. With TRIM the drive invalidates the deleted pages immediately, and without it they stay valid until rewritten.
Compressed size is a setting too. At 50% on a full drive with random writes and 7% overprovisioning, the data fills half the user area, so garbage collection finds nearly empty blocks and WAF falls from near 9 to about 1.2.
Static wear leveling follows Chang, Hsieh and Kuo (DAC 2007). In the paper’s worst case, 256 hot blocks and 3,840 blocks of static data with T = 100, it adds under 1% to the erases and about 7.6% to the live-page copies, at 128 pages a block and 16 pages copied per hot-block clean. This sandbox has no fixed hot and static split, so it reports what it measures.
Every run is seeded, so the same settings always give the same numbers, and the trends hold up as you change a setting.