九色国产,午夜在线视频,新黄色网址,九九色综合,天天做夜夜做久久做狠狠,天天躁夜夜躁狠狠躁2021a,久久不卡一区二区三区

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
nginx中的超時(shí)設(shè)置

nginx中的超時(shí)設(shè)置

nginx使用proxy模塊時(shí),默認(rèn)的讀取超時(shí)時(shí)間是60s。


1. send_timeout

syntax: send_timeout the time

default: send_timeout 60

context: http, server, location

Directive assigns response timeout to client. Timeout is established not on entire transfer of answer, but only between two operations of reading, if after this time client will take nothing, then nginx is shutting down the connection.

 

2. 負(fù)載均衡配置時(shí)的2個(gè)參數(shù):fail_timeoutmax_fails

   這2個(gè)參數(shù)一起配合,來(lái)控制nginx怎樣認(rèn)為upstream中的某個(gè)server是失效的當(dāng)在fail_timeout的時(shí)間內(nèi),某個(gè)server連 接失敗了max_fails次,則nginx會(huì)認(rèn)為該server不工作了。同時(shí),在接下來(lái)的 fail_timeout時(shí)間內(nèi),nginx不再將請(qǐng)求分發(fā)給失效的server。
個(gè)人認(rèn)為,nginx不應(yīng)該把這2個(gè)時(shí)間用同一個(gè)參數(shù)fail_timeout來(lái)控制,要是能再增加一個(gè)fail_time,來(lái)控制接下來(lái)的多長(zhǎng)時(shí)間內(nèi),不再使用down掉的server就更好了~
如果不設(shè)置這2個(gè)參數(shù),fail_timeout默認(rèn)為10s,max_fails默認(rèn)為1。就是說(shuō),只要某個(gè)server失效一次,則在接下來(lái)的10s內(nèi),就不會(huì)分發(fā)請(qǐng)求到該server上

3. proxy模塊的 proxy_connect_timeout

syntax: proxy_connect_timeout timeout_in_seconds

context: http, server, location

This directive assigns a timeout for the connection to the proxyserver. This is not the time until the server returns the pages, this is the proxy_read_timeout statement. If your proxyserver is up, but hanging (e.g. it does not have enough threads to process your request so it puts you in the pool of connections to deal with later), then this statement will not help as the connection to the server has been made. It is necessary to keep in mind that this time out cannot be more than 75 seconds.

 

4. proxy模塊的proxy_read_timeout

syntax: proxy_read_timeout the_time

default: proxy_read_timeout 60

context: http, server, location

This directive sets the read timeout for the response of the proxied server. It determines how long NGINX will wait to get the response to a request. The timeout is established not for entire response, but only between two operations of reading.

In contrast to proxy_connect_timeout, this timeout will catch a server that puts you in it's connection pool but does not respond to you with anything beyond that. Be careful though not to set this too low, as your proxy server might take a longer time to respond to requests on purpose (e.g. when serving you a report page that takes some time to compute). You are able though to have a different setting per location, which enables you to have a higher proxy_read_timeout for the report page's location.

If the proxied server nothing will communicate after this time, then nginx is shut connection.


5. proxy_send_timeout
后端服務(wù)器數(shù)據(jù)回傳時(shí)間_就是在規(guī)定時(shí)間之內(nèi)后端服務(wù)器必須傳完所有的數(shù)據(jù)

另一個(gè)參考:504 Gateway Time-out問(wèn)題

常見(jiàn)于使用nginx作為web server的服務(wù)器的網(wǎng)站

我遇到這個(gè)問(wèn)題是在升級(jí)discuz論壇的時(shí)候遇到的

一般看來(lái), 這種情況可能是由于nginx默認(rèn)的fastcgi進(jìn)程響應(yīng)的緩沖區(qū)太小造成的, 這將導(dǎo)致fastcgi進(jìn)程被掛起, 如果你的fastcgi服務(wù)對(duì)這個(gè)掛起處理的不好, 那么最后就極有可能導(dǎo)致504 Gateway Time-out
現(xiàn)在的網(wǎng)站, 尤其某些論壇有大量的回復(fù)和很多內(nèi)容的, 一個(gè)頁(yè)面甚至有幾百K
默認(rèn)的fastcgi進(jìn)程響應(yīng)的緩沖區(qū)是8K, 我們可以設(shè)置大點(diǎn)
在nginx.conf里, 加入:

fastcgi_buffers 8 128k

這表示設(shè)置fastcgi緩沖區(qū)為8×128k
當(dāng)然如果您在進(jìn)行某一項(xiàng)即時(shí)的操作, 可能需要nginx的超時(shí)參數(shù)調(diào)大點(diǎn), 例如設(shè)置成60秒:

send_timeout 60;

    調(diào)整了這兩個(gè)參數(shù), 結(jié)果就是沒(méi)有再顯示那個(gè)超時(shí), 可以說(shuō)效果不錯(cuò), 但是也可能是由于其他的原因, 目前關(guān)于nginx的資料不是很多, 很多事情都需要長(zhǎng)期的經(jīng)驗(yàn)累計(jì)才有結(jié)果。
 

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 32 4k;
proxy_busy_buffers_size 64k;


本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶(hù)發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
Nginx主配置文件nginx.conf史上超細(xì)中文詳解
(總結(jié))Nginx配置文件nginx.conf中文詳解
深入理解Nginx模塊開(kāi)發(fā)與架構(gòu)解析
nginx FastCGI buffer配置
[原創(chuàng)]Tengine與tengine 配置參數(shù)詳解
Nginx負(fù)載均衡與高可用的實(shí)現(xiàn)
更多類(lèi)似文章 >>
生活服務(wù)
熱點(diǎn)新聞
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服