fastcgi_connect_timeout Syntax: fastcgi_connect_timeout time;
Default: fastcgi_connect_timeout 60s;
Context: http, server, location
Defines a timeout for establishing a connection with a FastCGI server. It should be noted that this timeout cannot usually exceed 75 seconds.
表示nginx服务器和后端fastcgi服务器服务器连接的超时时间默认60s,这个参数值通常不要超过75s,因为建立的连接越多消耗的资源就越多
fastcgi_send_timeout
Syntax: fastcgi_send_timeout time;
Default: fastcgi_send_timeout 60s;
Context: http, server, location
Sets a timeout for transmitting a request to the FastCGI server. The timeout is set only between two successive write operations, not for the transmission of the whole request.
If the FastCGI server does not receive anything within this time, the connection is closed.
设置nginx允许fastcgi服务器端返回数据的超时时间,即在规定时间之内后端服务器必须传完所有数据,否则,nginx将断开这个连接,默认为60s
fastcgi_read_timeout
Syntax: fastcgi_read_timeout time;
Default: fastcgi_read_timeout 60s;
Context: http, server, location
Defines a timeout for reading a response from the FastCGI server. The timeout is set only between two successive read operations, not for the transmission of the whole response.
If the FastCGI server does not transmit anything within this time, the connection is closed.
设置nginx从fastcgi服务器端读取响应信息的超时时间,表示连接建立成功后,nginx等待后端服务器的响应时间,是nginx已经进入后端的排队之中等待处理的时间
fastcgi_buffer_size
Syntax: fastcgi_buffer_size> Default: fastcgi_buffer_size 4k|8k;
Context: http, server, location
Sets the>
By default, the buffer> 这个是nginx fastcgi的缓冲区大小参数,设定用来读取从fastcgi服务器收到的第一部分响应信息的缓冲区大小,这里的第一部分通常会包含一个小的响应头部,默认情况,这个参数的大小是由fastcgi_buffers指定的一个缓冲区大小。
fastcgi_buffers
Syntax: fastcgi_buffers number> Default: fastcgi_buffers 8 4k|8k;
Context: http, server, location
Sets the number and>
By default, the buffer> 指定本地需要用多少和多大的缓冲区来缓冲FastCGI的应答请求。如果一个PHP脚本所产生的页面大小为256KB,那么会为其分配4个64KB的缓冲区来缓存;
如果页面大小大于256KB,那么大于256KB的部分会缓存到fastcgi_temp指定的路径中,但是这并不是好方法,因为内存中的数据处理速度要快于硬盘。
一般这个值应该为站点中PHP脚本所产生的页面大小的中间值,如果站点大部分脚本所产生的页面大小为256KB,那么可以把这个值设置为“16 16k”、“4 64k”等。
fastcgi_busy_buffers_size
Syntax: fastcgi_busy_buffers_size> Default: fastcgi_busy_buffers_size 8k|16k;
Context: http, server, location
When buffering of responses from the FastCGI server is enabled, limits the total> In the meantime, the rest of the buffers can be used for reading the response and, if needed, buffering part of the response to a temporary file.
By default,> fastcgi_temp_file_write_size
Syntax: fastcgi_temp_file_write_size> Default: fastcgi_temp_file_write_size 8k|16k;
Context: http, server, location
Limits the>
By default,> fastcgi_temp_path
Syntax: fastcgi_temp_path path [level1 [level2 [level3]]];
Default: fastcgi_temp_path fastcgi_temp;
Context: http, server, location
Defines a directory for storing temporary files with data received from FastCGI servers. Up to three-level subdirectory hierarchy can be used underneath the specified directory.
For example, in the following configuration fastcgi_temp_path /spool/nginx/fastcgi_temp 1 2;
a temporary file might look like this:
/spool/nginx/fastcgi_temp/7/45/00000123457
See also the use_temp_path parameter of the fastcgi_cache_path directive.
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
fastcgi_temp_path /usr/local/nginx/fastcgi_tmp 1 2;
fastcgi_cache(buffer一份给用户,一份写到缓存)
表示开启FastCGI缓存并为其指定一个名称。开启缓存非常有用,可以有效降低CPU的负载,并且防止502错误的发生,但是开启缓存也会引起很多问题,要视具体情况而定。
为FastCGI缓存指定一个文件路径、目录结构等级、关键字区域存储时间和非活动删除时间
Syntax: fastcgi_cache_path path [levels=levels] [use_temp_path=on|off] keys_zone=name:size [inactive=time] [max_size=size]
[manager_files=number] [manager_sleep=time] [manager_threshold=time] [loader_files=number] [loader_sleep=time]
[loader_threshold=time] [purger=on|off] [purger_files=number] [purger_sleep=time] [purger_threshold=time];
Default: —
Context: http |