[QUIC] When old worker listen fd detach ebpf reuseport group when reload

Gao,Yan(ACG VCP) gaoyan09 at baidu.com
Wed Mar 10 06:11:46 UTC 2021


I test nginx-quic with ngtcp2:
~/ngtcp2/examples/client 127.0.0.1 443 https://example.com:443/index.html --dcid=1a812bf8290b2bd5

And same dcid not always hash to same worker,as access.log:
127.0.0.1 - - [10/Mar/2021:14:04:00 +0800] "GET /index.html HTTP/3.0" 200 788 "-" "nghttp3/ngtcp2 client" "quic" "h3-29" 88 9149
127.0.0.1 - - [10/Mar/2021:14:04:05 +0800] "GET /index.html HTTP/3.0" 200 788 "-" "nghttp3/ngtcp2 client" "quic" "h3-29" 94 9149
127.0.0.1 - - [10/Mar/2021:14:04:09 +0800] "GET /index.html HTTP/3.0" 200 788 "-" "nghttp3/ngtcp2 client" "quic" "h3-29" 100 9147

The last column shows nginx worker pid

Nginx.conf:

worker_processes  4;
error_log  logs/error.log  debug;

events {
    worker_connections  1024;
}

quic_bpf on;

http {
    log_format quic '$remote_addr - $remote_user [$time_local] '
                    '"$request" $status $body_bytes_sent '
                    '"$http_referer" "$http_user_agent" "$quic" "$http3" $connection $pid';

    access_log logs/access.log quic;

    server {
        listen 443 http3 reuseport;
        listen 443 ssl;

        ssl_certificate     server.crt;
        ssl_certificate_key server.key;
        ssl_protocols       TLSv1.3;

        location / {
            add_header Alt-Svc '$http3=":443"; ma=86400';
        }
    }
}

sbin/nginx -V
nginx version: nginx/1.19.7
built by gcc 8.4.0 (Ubuntu 8.4.0-3ubuntu2)
built with OpenSSL 1.1.1 (compatible; BoringSSL) (running with BoringSSL)
TLS SNI support enabled
configure arguments: --with-debug --with-http_v3_module --with-http_quic_module --with-cc-opt=-I../boringssl/include --with-ld-opt='-L../boringssl/build/ssl -L../boringssl/build/crypto'


uname -a
Linux nginx-quic 5.10.0-051000-generic #202012132330 SMP Sun Dec 13 23:33:36 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Gao,Yan(ACG VCP)

发件人: "Gao,Yan(ACG VCP)" <gaoyan09 at baidu.com>
日期: 2021年3月10日 星期三 上午11:17
收件人: "nginx-devel at nginx.org" <nginx-devel at nginx.org>, "vl at nginx.com" <vl at nginx.com>
主题: Re: [QUIC] When old worker listen fd detach ebpf reuseport group when reload

Hello Vladimir Homutov,

>I'm not sure I understand what you are trying to do.
>Do you have some issues with existing quic implementations in nginx?


I just want to know how nginx handle old and new quic connections when reload.
Nginx keep quic connections open when reload to complete old connections.
But new connections can still be handled by old workers.
Can the listening fd detach from reuseport group with keeping open, as kernel says, ebpf only look up an unconnected socket for a packet (UDP)

Gao,Yan(ACG VCP)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20210310/e4372749/attachment-0001.htm>


More information about the nginx-devel mailing list