Welcome! Log In Create A New Profile

Advanced

nginx, grpc and client body buffering

Posted by drookie 
nginx, grpc and client body buffering
January 29, 2020 10:32AM
Hello,

Seems like when using grpc on nginx 1.16.x the client body is _always_ buffered on the disk. Yeah, seems absolutely weird, but:

1) here's the $request_lengths (not $body_bytes_sent), top 25 unique entries:

[root@b0 nginx]# cat /var/log/nginx/balancer/foo.bar.tld-access.log | awk -F\" '{print $3}' | awk '{print $3}' | sort -urn | head -n 25
1272
1080
308
307
306
305
304
303
302
301
300
299
298
297
296
295
275
274
273
272
271
270
269
268
126

2) in the same time these were collected I got gazillions of "a client request body is buffered to a temporary file" log entries for a given vhost.
3) this nginx instance is running with client_body_buffer_size 128k;
4) no other vhosts except this one - gRPC-enabled, are complaining about this with what seems to be a 100% hitrate. I mean, yeah, they do complain sometimes, with a rate that seems reasonable. But here I got several dozens of gigs of log messages per day about buffering. In the same time I just don;t see in logs request_lengths close or comparable with 128k.
5) I've checked the same in PHP - the pool thinks the content-length for POSTS was very small too, similar to what nginx is reporting.

I'm not creating a ticket on this only because I still think I'm missing something, and yeah, it seems weird. Have someone seen something similar ?

Thanks.
Eugene.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 107
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready