Working on a block store in Rust and I'm learning that "written" and "durable" are completely different things. 4KB writes go to the OS page cache which resides in RAM and takes about 3us to write.
A power cycle would lose that data. fsync (which is guaranteed by the OS to write the data to disk) takes approximately 3-4ms which is over 1000x slower. Thus, storage systems ack writes right away and only guarantee durability at a flush.
@DevanshuXiSo I am building a block store system called Acheron (🦂) (inspired by Crucible @oxidecomputer) .
So the idea is that it replicates a single virtual disk across 3 machines where every write is made to all 3 replicas which means that if one node experiences delays, or fails, the other nodes can continue serving the disk.
I'm particurly interested to see how the system performs when the amount of traffic doubles, or when one of the replicas becomes 10x slower. Although most requests may be handled quickly, a few requests may take 100x longer and if your request falls into this category, it will be slow.
How can we reduce this tail latency without affecting throughput? I'm looking at limiting the number of requests that can be in the queue, making reads wait 50 writes behind, and either throttling fast replicas or allowing them to proceed while the slow replica catches up. For each of these I will compare performance with a baseline implementation. The baseline will allow unlimited requests, and perform requests in the order they arrive. I will set fixed random seeds in order to replicate the same workloads, create failure scenarios, and generate plots showing p99.9 latency and throughput. Ideally reads will represent the writes, once a flush has completed, data should exist in 2 of the 3 disks, and every block will have a checksum so any bad reads are detected before being returned to the caller. I am making this project to improve my knowledge of Rust, system programming, storage and performance engineering. Storage has many interesting elements to learn from such as stalled disks, lost packets, and process failure. This is a learning project, so I will post updates on what I discover throughout this project.
