3 ms·
A complete nightmare. In the past I had to work on an IO-heavy system with 1-5ms read-latency guarantees and the only working solution was to completely manage
by alexey-salmin 3y ago
A complete nightmare. In the past I had to work on an IO-heavy system with 1-5ms read-latency guarantees and the only working solution was to completely manage all writes in the userspace. Manual buffering, manual throttling, manual fallocate, then either DIRECT_IO or mmap+sync_file_range depending on whether you need the written data to be readily available for reads or not.
There was a kernel patch though that solved around 95% of issues with no userspace changes: vm.dirty_write_behind. Unfortunately it never made it into the mainline kernel. [1]
For strong latency guarantees it ws insufficient but it greatly improved the typical network/IO spike alternations described above.
I'm surprised it was never fixed upstream despite that fact that even most basic and simple scenarios like "nginx writes a log file to the disk" sometimes explode with seconds-long lockups on memory-fat machines.
[1] https://lore.kernel.org/linux-fsdevel/156896493723.4334.13340481207144634918.stgit@buzz/ https://lore.kernel.org/linux-fsdevel/156896493723.4334.1334...
- tux1968 3y ago> Unfortunately it never made it into the mainline kernel. That is unfortunate, and a bit surprising given how positively both Linus Torvalds, and Jens Axboe, responded to the patch.