GeezerVison is showing github.com — Questioning the relevance of the write buffer · Issue #342 · logfellow/logstash-logback-encoder
Questioning the relevance of the write buffer #342
Description
As far as I know, a TCP output stream is already buffered "by nature". I mean the TCP stack itself has its own buffers (transmit window or else).
Adding another buffer on top of the stack increases the memory consumption (slightly) but also increase the amount of data lost when a connection is abruptly interrupted.
We set the buffer size to 0 since a while and did not notice any performance penalty.
I'm just wondering if that feature should stay and whether it has any positive benefit.
What do you think?
Activity
philsttr commented on Jul 18, 2019
I'm hesitant to totally remove the ability to buffer the output stream mainly because I don't have profiling data for every environment. There could be certain environments where buffering provides a better experience. From just googling around, it seems there are a lot of opinions on buffering socket output streams, but no strong consensus.
On the other hand, I am open to changing the default to be unbuffered. But I'm also hesitant to do that since the buffer has existed since the TCP appender was created, and I don't have any concrete performance data for any environment.
brenuart commented on Jul 18, 2019
CollaboratorAuthor
More actions
I understand. For your information we are running the appender on MacOS, Windows, Linux and Docker with the buffer set to 0 without any issue.
I'm just concerned about the amount of data that may be lost when a connection is lost and the write buffer doesn't help...
One could also argue that flushing the TCP output stream is not required and is actually a noop since there is no way to actually force the TCP stack to send the data currently in its buffers.
Anyway, feel free to close this issue or add a note about it in the documentation ;-)
added a commit that references this issue
on Apr 4, 2025This issue will close once commit 5c24afc is merged into the 'master' branch.5c24afc
Metadata
Metadata
Development
No branches or pull requestsIssue actions