Skip to content

Tune send buffer and surface send errors#3

Merged
lpgauth merged 1 commit into
masterfrom
cherry/send-buffer-tuning
May 21, 2026
Merged

Tune send buffer and surface send errors#3
lpgauth merged 1 commit into
masterfrom
cherry/send-buffer-tuning

Conversation

@lpgauth

@lpgauth lpgauth commented May 21, 2026

Copy link
Copy Markdown
Owner

Summary

Cherry-picks 414e5a6 from alpha into 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: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.

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.
@lpgauth lpgauth merged commit ca88cc3 into master May 21, 2026
4 checks passed
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

Successfully merging this pull request may close these issues.

1 participant