2017-06-22 387 views
0

我去了文檔,發現這些 #空閒連接將自動關閉的時間。 #設置爲infinite以完全禁用空閒連接超時。 空閒超時= 10秒akka http配置中的idle-timeout和request timeout有什麼區別?

# Defines the default time period within which the application has to 
# produce an HttpResponse for any given HttpRequest it received. 
# The timeout begins to run when the *end* of the request has been 
# received, so even potentially long uploads can have a short timeout. 
# Set to `infinite` to completely disable request timeout checking. 
# 
# If this setting is not `infinite` the HTTP server layer attaches a 
# `Timeout-Access` header to the request, which enables programmatic 
# customization of the timeout period and timeout response for each 
# request individually. 
request-timeout = 20 s 

我在我的服務器需要超過10秒來處理響應的情況,但發送類HTTPResponse客戶端和服務器之間的TCP連接之前超時,因爲閒置超時

雖然此時連接處於空閒狀態,但請求仍在處理中。

我認爲這是響應超時的責任?

在這種情況下,任何人都可以解釋空閒超時和響應超時之間的區別嗎?

回答

0

documentationmore details here

# The idle timeout for an open connection after which it will be closed 
    # Set to null or "infinite" to disable the timeout, but notice that this 
    # is not encouraged since timeout are important mechanisms to protect your 
    # servers from malicious attacks or programming mistakes. 
    idleTimeout = 75 seconds 

如果看起來你設置的空閒超時比請求超時低,所以它的優先級。您的空閒超時設置應該比請求超時更長,因此對於每個請求,請求超時決定何時關閉連接。

相關問題