October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

Diagnosing Disk I/O Bottlenecks in RocksDB: Write Amplification and Compaction

RocksDB write amplification and compaction can overwhelm storage or lag behind writes. Measure database statistics, device I/O, CPU, and free space before tuning.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If RocksDB is writing far more data to disk than your application sends, or compaction is falling behind, measure the workload and locate the bottleneck before changing options. RocksDB’s tuning guide recommends understanding the current system first; a setting that helps one workload or device can regress on another. Start by correlating RocksDB statistics and logs with device bandwidth, IOPS, CPU use, and free space.

How compaction creates disk I/O

RocksDB keeps data in sorted string table (SST) files. When a memtable fills, RocksDB flushes it into an L0 SST file. During the flush, duplicate and overwritten keys can be removed. Later, compaction reads selected SST files, merges their contents, and writes new files, often into lower levels. This maintenance reclaims obsolete data and affects read and space efficiency, but it also consumes storage bandwidth and CPU. The compaction policy determines which sorted runs and overlapping key ranges are rewritten. RocksDB Overview

As an Amazon Associate I earn from qualifying purchases.

As L0 files and pending compaction work accumulate, background maintenance may no longer keep pace with writes. The resulting backlog can increase disk use and read work; when configured stall conditions are reached, RocksDB slows or stops writes to prevent the backlog from growing unchecked.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What write amplification means—and what it does not

Write amplification is the number of bytes written to storage divided by the bytes written to the database. It captures physical writes associated with compaction and other database work relative to logical database writes. RocksDB’s tuning guide illustrates the calculation with 10 MB/s written to the database and 30 MB/s of observed disk writes: the ratio is 3. Those are explanatory example values, not a benchmark or a universal RocksDB result. RocksDB Tuning Guide

#1 Best Overall
Sale
Samsung SSD 990 PRO 2TB, PCIe 4.0 M.2 2280, Up to 7,450 MB/s
  • MEET THE NEXT GEN: Consider this a cheat code; Our Samsung 990 PRO Gen4 SSD helps you reach near max performance with lightning-fast speeds; Whether you’re a hardcore gamer or a tech guru, you’ll get power efficiency built for the final boss
  • REACH THE NEXT LEVEL: Gen4 steps up with faster transfer speeds and high-performance bandwidth; With a more than 55% improvement in random performance compared to 980 PRO, it’s here for heavy computing and faster loading
  • THE FASTEST SSD FROM THE WORLD'S FLASH MEMORY BRAND: The speed you need for any occasion; With read and write speeds up to 7450/6900 MB/s you’ll reach near max performance of PCIe 4.0 powering through for any use
  • PLAY WITHOUT LIMITS: Give yourself some space with storage capacities from 1TB to 4TB; Sync all your saves and reign supreme in gaming, video editing, data analysis and more
  • IT’S A POWER MOVE: Save the power for your performance; Get power efficiency all while experiencing up to 50% improved performance per watt over the 980 PRO; It makes every move more effective with less consumption

Measurement boundaries matter. Device write totals may include the write-ahead log (WAL), other processes, and activity outside the database files. Compare rates over the same interval and understand what each counter includes; do not assume every device write came from compaction.

RocksDB’s tuning guide also gives a simplified capacity example: if write amplification is 50 and maximum disk throughput is 500 MB/s, the implied database write rate is 10 MB/s. This is arithmetic under the guide’s assumptions, not a performance prediction. Actual sustainable throughput depends on the workload, device, available bandwidth, and other activity.

Rank #2
Sale
Kingston NV3 1TB M.2 2280 NVMe SSD | PCIe 4.0 Gen 4x4 | Up to 6000 MB/s | SNV3S/1000G
  • Ideal for high speed, low power storage
  • Gen 4x4 NVMe PCle performance
  • Up to 6,000MB/s read, 4,000MB/s write
  • Includes Acronis cloning software
  • 5-year limited warranty

Write amplification is only one dimension of the trade-off. Read amplification concerns disk reads per query; distinguish logical cache reads from physical device reads. Space amplification compares database-file size with the data size. System-level physical read counts may include compaction as well as foreground lookups, so they cannot automatically be attributed to application queries. Compaction policy shifts the balance among write, read, and space amplification.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to tell what is limiting RocksDB

Use measurements from the database and the host at the same time. The RocksDB tuning guide recommends finding the bottleneck before tuning and cautions that fine tuning without an evident problem can be counterproductive. RocksDB Tuning Guide

Rank #3
Sandisk Optimus 5100 500GB NVMe SSD, PCIe 4.0, M.2 2280
  • SPEED UP PROJECTS. Launch creator applications fast with uncompromising PCIe 4.0 read speeds up to 7,100MB/s,[2] (1TB and 2TB[1] models) and write speeds up to 6,700MB/s[2] (1TB[1]-4TB[1] models).
  • CREATE AND STORE MORE. Make more room for your 4K videos and high-resolution images with capacities from 500GB[1] up to 4TB[1] on M.2 2280 built with our trusted 8th generation SANDISK BiCS QLC 3D CBA NAND.
  • IT GOES WHERE YOU GO. With an all-new power efficient design, your drive delivers high performance with low power, giving you more time to be productive while on the go.
  • UNCOMPROMISED RELIABILITY. With up to 1,200 TBW[3] (4TB[1] model) endurance rating, your drive is designed for creators.
  • KEEP YOUR DRIVE UPDATED. Monitor your SSD’s performance and check for updates with the downloadable SANDISK Dashboard application.[5]
  1. Describe the symptom and workload. Record whether the issue is foreground latency, write throughput, or disk capacity. Note the read/write mix, update distribution, key ordering, data size, column-family layout, storage device, and deployed RocksDB version. There is no workload-independent target that the official guidance establishes for these measurements.
  2. Inspect RocksDB’s own signals. Review rocksdb.stats or the configured DB statistics, compaction statistics, and DB status. Use per-query Perf Context or IO Stats Context when you need to see where an individual operation spends time. These signals help distinguish request cost from background work and reveal tree shape or stalls.
  3. Measure the host concurrently. Observe disk read and write bandwidth, read IOPS, CPU use, and free space during representative load. If read IOPS may be limiting, measure the target workload with a system tool such as fio; practical sustained IOPS can be below a device’s headline specification.
  4. Correlate backlog and stalls. Check the RocksDB LOG for stall signals and compare them with compaction statistics. A growing L0 file count or pending compaction work suggests background maintenance is falling behind. Determine whether storage, CPU, or configured background-job parallelism is the limiting factor before changing a threshold.
  5. Change one relevant variable at a time. Repeat measurements under representative load after each change. Account for memory budget, query pattern, hardware, and RocksDB version rather than copying a setting from another system.

Why write stalls happen

A write stall is a protective response when flush or compaction cannot keep up. Slowing writers prevents continued growth in space amplification and read amplification, but stalls can still cause unexpected slowness or timeouts. RocksDB directs operators to the LOG and compaction statistics to diagnose them. Write Stalls

Raising stall thresholds may delay or suppress the visible symptom without increasing sustainable device or compaction capacity. First find out why maintenance is behind. If writes are already outrunning available bandwidth, allowing the backlog to grow can leave the database with more pending work and less room to manage it.

Rank #4
Sale
Samsung SSD 990 PRO 1TB, PCIe 4.0 M.2 2280, Up to 7,450 MB/s
  • HUGE SPEED BOOST: Get random read/write speeds that are 40%/55% faster than 980 PRO; Experience up to 1400K/1550K IOPS, while sequential read/write speeds up to 7,450/6,900 MB/s reach near the max performance of PCIe 4.0*
  • BREAKTHROUGH POWER EFFICIENCY: Use less power and get more performance; Enjoy up to 50% improved performance per watt over 980 PRO, plus optimal power efficiency with max PCIe 4.0 performance**
  • SMART THERMAL CONTROL: Samsung's own nickel-coated controller delivers effective thermal control; With its slim size, 990 PRO is a perfect fit for desktops and laptops that meet the PCI-SIG D8 standard***
  • THE CHAMPION MAKER: Up to 65% improvement in random performance enables faster loads for an ultimate gaming experience on PS5 and DirectStorage PC games****
  • SAMSUNG MAGICIAN SOFTWARE: Get the most out of your SSD with Samsung Magician's advanced yet intuitive optimization tools; Monitor drive health, protect valuable data, and receive important updates for your 990 PRO

How compaction styles trade I/O, reads, and space

Compaction style affects which files are merged and rewritten. The options are trade-offs, not a universal ranking: evaluate write amplification alongside read behavior, space needs, traffic shape, and the workload’s key and update pattern.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Style Write and read behavior Space and workload considerations
Leveled RocksDB’s default style generally favors space efficiency, while repeated merging can increase write amplification. Its some-to-some overlapping-file behavior means amplification depends on workload and key ranges; it is not a fixed factor. Assess actual overlap and compaction behavior rather than assuming every level is rewritten on every compaction.
Universal (tiered family) Typically targets lower write amplification than leveled compaction, at the cost of higher read amplification and space amplification. Major compaction can temporarily require roughly another output-sized copy of data. Free disk space and read behavior are important constraints; lower write amplification is not a free improvement. Universal Compaction
FIFO Drops the oldest file when its configured size limit is exceeded rather than serving as a general compaction cure. Consider it only for cache-like data where that retention behavior is appropriate. RocksDB Overview

The RocksDB project describes Universal compaction as targeting lower write amplification while trading off read and space amplification. Choose it only when that balance fits the workload and available capacity. Universal Compaction

Best Value
WD_Black SN7100 1TB NVMe SSD - Gen4 PCIe, M.2 2280, Up to 7,250 MB/s Read Speed, Up to 6,900 MB/s Write Speed, Next Gen TLC 3D NAND, for Laptops, Handheld Gaming Devices - WDS100T4X0E
  • This product has been replaced by our latest generation. Please search for the SANDISK Optimus GX 7100 NVMe SSD
  • HIGH-OCTANE GAMING. Experience speeds up to 7,250MB/s read and 6,900MB/s write (1-2TB models), with up to 35% faster performance than previous generation.
  • PURPOSE-BUILT. Designed for serious on-the-go gamers, with a PCIe Gen4 interface and SANDISK’s next generation TLC 3D NAND.
  • MORE TIME TO CLEAR THAT CHECKPOINT. Built with laptops and handheld gaming devices in mind, with up to 100% more power efficiency over the previous generation.
  • DO MORE WITH DASHBOARD. Ensure your drive is optimized for prime performance with the downloadable WD_BLACK Dashboard (Windows only).
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What to investigate after finding the bottleneck

Tuning direction depends on the measured constraint. These are diagnostic paths, not guaranteed fixes:

  • Compaction lags but the device is not saturated: inspect configured background-job and compaction parallelism. RocksDB’s tuning guide notes that configured parallelism can limit compaction even when an SSD is not fully utilized. Check CPU and workload constraints before increasing concurrency.
  • Storage bandwidth is saturated: reduce compaction traffic only if the workload can tolerate the resulting read- or space-amplification trade-off, or address the storage limit. An NVMe SSD may be one deployment option to evaluate, but compare sustained write performance, endurance, capacity, and platform compatibility against your measured workload; the available guidance does not establish that a drive upgrade is the right fix.
  • Read IOPS are constrained: examine cache behavior and read-path counters as well as compaction. Device reads can reflect both foreground queries and background work.
  • Disk capacity is constrained: review space amplification, temporary compaction headroom, and compression choices. Universal compaction’s temporary space needs can matter even when its write amplification is attractive.
  • Latency outliers track background I/O: consider whether rate limiting flush or compaction could smooth I/O, while recognizing it may slow maintenance. Flash discard or trimming can also have temporary latency effects.

Use defaults and setup guidance carefully

RocksDB says ordinary SSD workloads often work reasonably with defaults and discourages fine tuning without a clear problem. Its basic setup-options page, last edited 2022-11-01, gives version-sensitive guidance: a 64 MB default column-family write buffer, budgeting for twice worst-case memory use, and a block cache around one-third of the total memory budget. It also says a Bloom filter with 10 bits per key yields about a 1% false-positive rate for the configuration it describes. Treat these as guidance from that page, not universal current defaults or promises of improvement. Verify settings against the deployed release. Setup Options and Basic Tuning

That guide also frames compression as a CPU, I/O, and space trade-off; recommends Bloom filters for point lookups rather than range scans; and suggests rate limiting flush and compaction when smoothing I/O can help avoid read-latency outliers. Apply each only when its trade-off matches the observed workload. The setup page itself cautions that its suggested options are unlikely to yield significant improvement by themselves. Setup Options and Basic Tuning

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.