Skip to content

Tests: rcvbuf and sndbuf directives for upstream sockets#47

Open
patrikwl wants to merge 3 commits into
nginx:masterfrom
patrikwl:stream-proxy-socket-buf
Open

Tests: rcvbuf and sndbuf directives for upstream sockets#47
patrikwl wants to merge 3 commits into
nginx:masterfrom
patrikwl:stream-proxy-socket-buf

Conversation

@patrikwl
Copy link
Copy Markdown

Adds stream_proxy_socket_buf.t covering proxy_socket_rcvbuf
and proxy_socket_sndbuf in the four configurable forms: off,
explicit size, max, and default-no-directive. Each subtest
asserts a small message proxies through end-to-end, exercising
the setsockopt() path during outbound connect.

The directives are introduced in nginx/nginx#1298.

Refs nginx/nginx#1297.

@patrikwl
Copy link
Copy Markdown
Author

Update: I’ve extended this tests PR to cover the HTTP upstream follow-up as well.

The PR now includes:

  • stream_proxy_socket_buf.t

    • still covers proxy_socket_rcvbuf and proxy_socket_sndbuf
    • covers off, explicit size, max, and default-no-directive
    • now also verifies the configured upstream socket buffers with ss -tnpemi
  • proxy_socket_buf.t

    • added for HTTP upstream socket buffer directives
    • covers proxy_socket_rcvbuf and proxy_socket_sndbuf at runtime
    • verifies the kernel-visible upstream socket buffers with ss -tnpemi
    • covers config parsing for:
      • fastcgi_socket_rcvbuf / fastcgi_socket_sndbuf
      • grpc_socket_rcvbuf / grpc_socket_sndbuf
      • memcached_socket_rcvbuf / memcached_socket_sndbuf
      • scgi_socket_rcvbuf / scgi_socket_sndbuf
      • uwsgi_socket_rcvbuf / uwsgi_socket_sndbuf
    • covers invalid values and duplicate directive handling

Verified locally with:

```sh
prove -v proxy_socket_buf.t stream_proxy_socket_buf.t
```

Result: all tests pass.

The corresponding nginx source changes are in nginx/nginx#1298.

Refs nginx/nginx#1297.

@patrikwl patrikwl changed the title Tests: stream proxy socket buffer directives Tests: rcvbuf and sndbuf directives for upstream sockets May 13, 2026
patrikwl added 3 commits May 13, 2026 14:41
Adds stream_proxy_socket_buf.t covering proxy_socket_rcvbuf and
proxy_socket_sndbuf in the four configurable forms: "off",
explicit size, "max", and default-no-directive.  Each subtest
asserts a small message proxies through end-to-end, exercising
the setsockopt() path during outbound connect.

The directives are introduced in nginx/nginx#1297.
Added proxy_socket_buf.t to cover HTTP upstream socket buffer
directives, including proxy runtime checks with ss -tnpemi and
configuration parsing for fastcgi, grpc, memcached, scgi, and uwsgi.

Extended stream proxy socket buffer tests to verify the configured
buffers on the upstream socket with ss -tnpemi.
Added tunnel_socket_rcvbuf and tunnel_socket_sndbuf parsing coverage
to proxy_socket_buf.t.
@patrikwl patrikwl force-pushed the stream-proxy-socket-buf branch from 11bbdbd to 53e7ec9 Compare May 13, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: External Pull Requests

Development

Successfully merging this pull request may close these issues.

2 participants