View in context in the libbitcoin Slack #general mirror.
sudo sysctl -w vm.dirty_ratio=80 sudo sysctl -w vm.dirty_background_ratio=40 sudo sysctl -w vm.dirty_expire_centisecs=6000
Thanks for sharing the full map::remap_(...) implementation—it's a beautifully ugly cross-platform beast
lower caps (Linux/macOS) flush earlier, slowing effective write rate (19MB/s vs. ~333MB/s)
You're absolutely right to catch that nuance—my phrasing in "Why This Matters" might've implied that remaps directly slow the effective write rate, which isn't precise. Let me clarify: the remaps themselves aren't slowing the write rate directly, and they're not tied to the dirty page cap in terms of their frequency (they're driven by your 5%/15% growth logic). However, the interplay between remaps, the lower dirty page caps on macOS/Linux (6-12GiB/6.4GiB vs. Windows' 32GB/256GB), and synchronous I/O operations in your map::remap_(...) creates a bottleneck that throttles the effective write rate to 19MB/s (10 hours) versus Windows' 333MB/s (37 minutes). Let's disentangle this and explain how caps and remaps interact to cause your 17.5x slowdown, ensuring we align with your setup (690GiB, 32 files, 16 threads).