Why does Mongodb production notes have no recommendations about the disk block size? AFAIU, disk block size would have a considerable impact on a throughput intensive application. Does disk block size have any impact on mongodb performance in practice?
Why does Mongodb production notes have no recommendations about the disk block size?
As per MongoDB documentation Configure Block Size in a Blockstore When you back up your deployment to a Blockstores, the Backup Daemon first takes a snapshot of the head database. It then breaks this snapshot into blocks and writes these blocks to the blockstore.
The different blockstores have different default sizes and ranges of sizes for blocks.
Blockstore Type Block Size Range Default Size MongoDB 64 KB to 15 MB 64 KB S3 64 KB to 16 MB 16 MB
In general, increasing block size results in faster snapshots and restores, but requires more disk space. These competing factors should be considered when determining if you wish to tune the block size.
There are two exceptions where performance improves as the block size increases without requiring additional disk space:
Workload Impact Update- and Delete-Intensive No matter how small you make the block size, the entire block file is rewritten. Since the entire file is always rewritten, there is no difference in storage space if you change the block size. Insert-only The existing blocks never change. As you increase block size, block management is simplified. This enables the best possible performance on snapshot and restore.
The range of minimum block sizes include:
64 KB 128 KB 256 KB 512 KB 1 MB 2 MB 4 MB 8 MB 15 MB (MongoDB) or 16 MB (S3)
Does disk block size have any impact on mongodb performance in practice?
As per Blog from
@Colt McAnlis, here “The default block size on volumes is
4K. For throughput-oriented workloads, values of
256KB or above are recommended.”
It’s important to observe the following formula wrt disk performance:
Throughput (M/sB) = IOPS * Blocksize.
How this evens out is that IOPS and block Size tend to have an inverse relationship to each other. As block size increases, it takes longer latency to read a single block, and thus the # of IOPS decreases. Inversely, smaller block sizes yield higher IOPS.
For further your ref here