閱讀497 返回首頁    go 阿裏雲 go 技術社區[雲棲]


有關tengine幾個超時時間說明

負載均衡的客戶和技術支持同學經常問: 7層 HTTP Keepalive 超時時間 是15秒 和http 60S 這個超時時間有什麼區別? 下邊列出來具體的含義

1. keepalive_timeout 15s;

長連接中連續兩個http/https請求之間空閑的最大時間,超過此時間後沒有收到新請求會關閉TCP長連接

The first parameter sets a timeout during which a keep-alive client connection will stay open on the server side. The zero value disables keep-alive client connections. The optional second parameter sets a value in the “Keep-Alive: timeout=time” response header field. Two parameters may differ.
The “Keep-Alive: timeout=time” header field is recognized by Mozilla and Konqueror. MSIE closes keep-alive connections by itself in about 60 seconds.

2. proxy_connect_timeout 5s;

等待一台後端ECS TCP三次握手完成過程的超時時間,超時後選擇下一台ECS或關閉與client的連接

Defines a timeout for establishing a connection with a proxied server. It should be noted that this timeout cannot usually exceed 75 seconds.

3. proxy_read_timeout 60s;

等待一台ECS 回複http/https請求的響應時間

Defines a timeout for reading a response from the proxied server. The timeout is set only between two successive read operations, not for the transmission of the whole response. If the proxied server does not transmit anything within this time, the connection is closed.

4. client_body_timeout 60s

兩次連續可讀body數據時的超時時間間隔, 超時後返回408 Request Timeout請求超時。客戶端沒有在服務器預備等待的時間內完成一個請求的發送。

Defines a timeout for reading client request body. The timeout is set only for a period between two successive read operations, not for the transmission of the whole request body. If a client does not transmit anything within this time, the 408 (Request Time-out) error is returned to the client.

5. client_header_timeout 1m;

讀客戶端請求頭超時間, 超時後返回408 Request Timeout請求超時。客戶端沒有在服務器預備等待的時間內完成一個請求的發送。

Defines a timeout for reading client request header. If a client does not transmit the entire header within this time, the 408 (Request Time-out) error is returned to the client.

6. send_timeout 1m;

兩次連續向客戶端可寫body數據時的超時時間間隔,超時後直接完畢連接

Sets a timeout for transmitting a response to the client. The timeout is set only between two successive write operations, not for the transmission of the whole response. If the client does not receive anything within this time, the connection is closed.

7. ssl_handshake_timeout 60s;

完成https ssl握手過程超時時間

Specifies a timeout for the SSL handshake to complete.

8. ssl_session_timeout 5m;

同一客戶端https參數重用緩存時間,可以提高ssl握手交互的效率

Specifies a time during which a client may reuse the session parameters.

9. proxy_send_timeout 60s

兩次連續向後端ECS可寫body數據時的超時時間間隔,超時後直接完畢連接

Sets a timeout for transmitting a request to the proxied server. The timeout is set only between two successive write operations, not for the transmission of the whole request. If the proxied server does not receive anything within this time, the connection is closed.

最後更新:2017-06-16 12:01:38

  上一篇:go  Android熱修複技術原理詳解與升級探索
  下一篇:go  怎麼善於發現seo網站優化的問題?