5 ms·
This still begs the question I've had since day one when learning about buffers: what the heck is the recommended buffer size. I've seen a lot of old code that
by Matt3o12_ 10y ago
This still begs the question I've had since day one when learning about buffers: what the heck is the recommended buffer size. I've seen a lot of old code that use extremely small buffer size as well as some recent code that use extremely high buffer sizes (up to 10MB).
What is a good sweet spot that runs well on older hardware (less then 10 years old) and new hardware? And should network buffers be bigger or smaller then disk buffers?
- RyanZAG 10y agoJudging by the post here, 512kb buffers seems like a good bet?
- mpweiher 10y agoFor a an SSD with 2GB/s throughput and the syscall overhead of OS X: yes. Go higher if you want some headroom for the next generation of faster SSDs.
- throwawayish 10y agoNetwork buffers are a completely different animal, also harder to optimize... Disk IO buffers, it's easy nowadays, just use something like a MB, which is just fine for almost any application, and doesn't stack up to much memory use (unless you're writing many files concurrently, which can bring it's own problems as well)
- yjftsjthsd-h 10y agoThat actually does sound about right, but do you know how to derive that? I'm curious how to figure it out.
- gens 10y agoJust do a test with dd or some small piece of code. Why rely on heresay.