Answer the question
In order to leave comments, you need to log in
How to calculate fastcgi buffers for nginx?
Good day!
There is nginx + php-fpm. Everything works, but sometimes messages arrive in the logs:
... [warn] ... an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/2/00/0000000002 while reading upstream, client: 192.168.2.50, server: test.site, request: "GET /... HTTP/2.0", upstream: "fastcgi://unix:/run/php/php-fpm.sock:", ...
Answer the question
In order to leave comments, you need to log in
Here everything is compressed and the numbers at the end are quite clear:
Avg. 24807 --> fastcgi_buffer_size 32k;
Max. 629622 --> fastcgi_buffers 32 32k;
That is, if I understand correctly, fastcgi_buffer_size must be set so that the average value fits into it, and fastcgi_buffers should be set accordingly so that the maximum value fits.
It is logical that the size of the buffer depends on the size of the response of your web server; if you set it less than typical, then the speed will slow down since the data will be 'cached' to a slow disk, if it is larger, then the data will remain in RAM, fast but occupying it.
the first result from Google gives a mini study with examples
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question