Tune send buffer and surface send errors#3
Merged
Conversation
Bidder workloads generate ~20KB bid responses that were silently lost when gen_tcp:send returned an error (e.g. peer RST). The send return value was discarded, and the default kernel sndbuf can be too small for multi-segment writes under tight RTB timing. - Set sndbuf=256KB, send_timeout=50ms, send_timeout_close=true on the listen socket so accepted sockets inherit them. - Wrap gen_tcp:send and emit [whitecap, connections, send_error] telemetry with the response size and reason on failure. - Close the connection on send error instead of looping into parse_requests against a dead socket.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cherry-picks
414e5a6fromalphainto master. Master already contains the listener-namespacing change (d7e7f65), so only the send-buffer commit is new.Bidder workloads generate ~20KB bid responses that were silently lost when
gen_tcp:sendreturned an error (e.g. peer RST). The send return value was discarded, and the default kernel sndbuf can be too small for multi-segment writes under tight RTB timing.sndbuf=256KB,send_timeout=50ms,send_timeout_close=trueon the listen socket so accepted sockets inherit them.gen_tcp:sendand emit[whitecap, connections, send_error]telemetry with the response size and reason on failure.parse_requestsagainst a dead socket.