comparison src/core/ngx_connection.h @ 8125:cffaf3f2eec8

Lingering close for connections with pipelined requests. This is expected to help with clients using pipelining with some constant depth, such as apt[1][2]. When downloading many resources, apt uses pipelining with some constant depth, a number of requests in flight. This essentially means that after receiving a response it sends an additional request to the server, and this can result in requests arriving to the server at any time. Further, additional requests are sent one-by-one, and can be easily seen as such (neither as pipelined, nor followed by pipelined requests). The only safe approach to close such connections (for example, when keepalive_requests is reached) is with lingering. To do so, now nginx monitors if pipelining was used on the connection, and if it was, closes the connection with lingering. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973861#10 [2] https://mailman.nginx.org/pipermail/nginx-devel/2023-January/ZA2SP5SJU55LHEBCJMFDB2AZVELRLTHI.html
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 02 Feb 2023 23:38:48 +0300
parents 32b0ba4855a6
children 0af598651e33
comparison
equal deleted inserted replaced
8124:f5515e727656 8125:cffaf3f2eec8
170 unsigned log_error:3; /* ngx_connection_log_error_e */ 170 unsigned log_error:3; /* ngx_connection_log_error_e */
171 171
172 unsigned timedout:1; 172 unsigned timedout:1;
173 unsigned error:1; 173 unsigned error:1;
174 unsigned destroyed:1; 174 unsigned destroyed:1;
175 unsigned pipeline:1;
175 176
176 unsigned idle:1; 177 unsigned idle:1;
177 unsigned reusable:1; 178 unsigned reusable:1;
178 unsigned close:1; 179 unsigned close:1;
179 unsigned shared:1; 180 unsigned shared:1;