3 ms·
I agree with you in theory if resources were infinite but there is no way to log at the rates developers actually want to log and have a performant application
by Spivak 5y ago
I agree with you in theory if resources were infinite but there is no way to log at the rates developers actually want to log and have a performant application without buffering.
I think the more practical advice is "buffer logs outside your application" or "buffer logs in a separate thread/process that crashes independently of your application code."
Even the small places I've worked could easily push 250G logs a day.
- yongjik 5y agoI guess "buffering in a separate process" can be handy, esp. if you have strict performance requirements, but I guess using shared memory correctly can be tricky...? (Without shared memory, I imagine you'll have one system call per log anyway - in which case it's not much different from calling one write() per line.)