nginx upstream response is buffered to a temporary file wordpress
especially while i am clicking on publish because response size big, its normal.
fastcgi_buffer_size 4K;
fastcgi_buffers 64 4k;
Fastcgi buffer will store responses up to 4K+64*4K=260K in memory
So when the request is out of in-memory buffer, data will be saved into files.
Don’t worry it’s not a problem.
#soluttion
to disable write to disk
To disable FastCGI disk buffering and get rid of all the an upstream response is buffered to a temporary file errors add this line:
fastcgi_max_temp_file_size 0;
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_max_temp_file_size 0;
fastcgi_buffer_size 4K;
fastcgi_buffers 64 4k;
include fastcgi_params;
}
Enables or disables buffering of responses from the FastCGI server.
Syntax: | fastcgi_buffering on | off; |
---|---|
Default: |
fastcgi_buffering on; |
Context: | http , server , location |
This directive appeared in version 1.5.6.
When buffering is enabled, nginx receives a response from the FastCGI server as soon as possible, saving it into the buffers set by the fastcgi_buffer_size and fastcgi_buffers directives. If the whole response does not fit into memory, a part of it can be saved to a temporary file on the disk. Writing to temporary files is controlled by the fastcgi_max_temp_file_size and fastcgi_temp_file_write_size directives.
understanding nginx fast cgi buffers
increasing fast cgi buffers
fastcgi_buffer_size 32k;
fastcgi_busy_buffers_size 64k;
Syntax: | fastcgi_buffersnumbersize; |
---|---|
Default: |
fastcgi_buffers 8 4k|8k; |
Syntax:fastcgi_buffer_sizesize;
Default:
fastcgi_buffer_size 4k|8k;
Context:http
, server
, location
increased to
fastcgi_buffers 16 64k;
fastcgi_buffer_size 64k;
fastcgi_busy_buffers_size 128k;
nginx: [emerg] “fastcgi_busy_buffers_size” must be equal to or greater than the maximum of the value of “fastcgi_buffer_size” and one of the “fastcgi_buffers” in /etc/nginx/nginx.conf:136