News for hackers. Stuff that matters.
Re:Mkfile(8) is severely syscall limited on OS X by Matt3o12_ on Sunday February 12, 2017 @07:27AM (#13628043)
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?

Re:Mkfile(8) is severely syscall limited on OS X by throwawayish on Sunday February 12, 2017 @07:57AM (#13628122)
Network 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)

Re:Mkfile(8) is severely syscall limited on OS X by yjftsjthsd-h on Sunday February 12, 2017 @09:07AM (#13628345)
That actually does sound about right, but do you know how to derive that? I'm curious how to figure it out.
Re:Mkfile(8) is severely syscall limited on OS X by RyanZAG on Sunday February 12, 2017 @08:51AM (#13628291)
Judging by the post here, 512kb buffers seems like a good bet?
Re:Mkfile(8) is severely syscall limited on OS X by mpweiher on Sunday February 12, 2017 @10:14AM (#13628671)
For 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.
Re:Mkfile(8) is severely syscall limited on OS X by gens on Sunday February 12, 2017 @10:18AM (#13628700)
Just do a test with dd or some small piece of code. Why rely on heresay.