Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questioning the relevance of the write buffer #342

Closed
brenuart opened this issue Jun 25, 2019 · 2 comments
Closed

Questioning the relevance of the write buffer #342

brenuart opened this issue Jun 25, 2019 · 2 comments
Milestone

Comments

@brenuart
Copy link
Collaborator

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?

@philsttr
Copy link
Collaborator

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
Copy link
Collaborator Author

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 ;-)

@philsttr philsttr added this to the 6.2 milestone Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants