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

Write the first body chunk in the initial packet. #557

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@nelhage

nelhage commented Mar 4, 2016

fixes #556

When #266 was fixed, it caused a regression in the behavior from #233,
which deliberately merged the initial writes to the socket, for network
efficiency and to avoid triggering the pathological behavior caused by
the combination of Nagle's Algorithm and TCP delayed ACKs.

Restore that optimization, in a slightly more general way: Do a
nonblocking read of an initial chunk of data off the provided body, and
merge that with the headers before sending.

Write the first body chunk in the initial packet.
When #266 was fixed, it caused a regression in the behavior from #233,
which deliberately merged the initial writes to the socket, for network
efficiency and to avoid triggering the pathological behavior caused by
the combination of Nagle's Algorithm and TCP delayed ACKs.

Restore that optimization, in a slightly more general way: Do a
nonblocking read of an initial chunk of data off the provided body, and
merge that with the headers before sending.
@nelhage

This comment has been minimized.

Show comment
Hide comment
@nelhage

nelhage Mar 4, 2016

I'm of mixed feelings about the read_nonblock approach; I like that it keeps the "we always treat body as an IO` simplification introduced in #266, but it also seems like it increases the possible surface area for weird interaction with weird bodies. I'm happy to go back to something that looks more like the pre-#266 code if you'd prefer.

nelhage commented Mar 4, 2016

I'm of mixed feelings about the read_nonblock approach; I like that it keeps the "we always treat body as an IO` simplification introduced in #266, but it also seems like it increases the possible surface area for weird interaction with weird bodies. I'm happy to go back to something that looks more like the pre-#266 code if you'd prefer.

@geemus

This comment has been minimized.

Show comment
Hide comment
@geemus

geemus Mar 7, 2016

Contributor

Hey, thanks for the details and kicking this off. I started from here and made a couple (hopefully good/reasonable) tweaks here: #559. What do you think?

Contributor

geemus commented Mar 7, 2016

Hey, thanks for the details and kicking this off. I started from here and made a couple (hopefully good/reasonable) tweaks here: #559. What do you think?

@geemus

This comment has been minimized.

Show comment
Hide comment
@geemus

geemus Mar 7, 2016

Contributor

adapted into #559

Contributor

geemus commented Mar 7, 2016

adapted into #559

@geemus geemus closed this Mar 7, 2016

@nelhage nelhage deleted the nelhage:single-packet branch Mar 7, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment