"connectionTimeout" 在 Tomcat 中到底是什么意思?
What exactly does "connectionTimeout" means in Tomcat?
在文档(Tomcat 7 Config)中,写着:
The number of milliseconds this Connector will wait, after accepting a connection, for the request URI line to be presented. Use a value of -1 to indicate no (i.e. infinite) timeout. The default value is 60000 (i.e. 60 seconds) but note that the standard server.xml that ships with Tomcat sets this to 20000 (i.e. 20 seconds). Unless disableUploadTimeout is set to false, this timeout will also be used when reading the request body (if any).
当客户端向服务器发送请求时,需要N毫秒才能建立连接。如果这个 N 超过了客户端设置的连接超时时间,请求将在客户端失败。
我无法理解 Tomcat 的 connectionTimeout
有何不同。具体来说,"after accepting a connection, for the request URI line to be presented" 是什么意思?
connectionTimeout
是服务器将自动关闭与客户端的连接的时间限制,而不是相反。这是一种限制 Denial Of Service Attack 影响的方法。实际上,进行 DOS 攻击 的典型方法是在给定服务器上启动多个请求,每个请求将永远持续下去,使服务器无所事事地等待并填满其线程池,这样服务器将无法接受任何新请求。由于此超时,x 毫秒后它将忽略请求,将其视为潜在攻击。
Here 是关于全球同一主题的有趣讨论,而且讨论更深入。
在文档(Tomcat 7 Config)中,写着:
The number of milliseconds this Connector will wait, after accepting a connection, for the request URI line to be presented. Use a value of -1 to indicate no (i.e. infinite) timeout. The default value is 60000 (i.e. 60 seconds) but note that the standard server.xml that ships with Tomcat sets this to 20000 (i.e. 20 seconds). Unless disableUploadTimeout is set to false, this timeout will also be used when reading the request body (if any).
当客户端向服务器发送请求时,需要N毫秒才能建立连接。如果这个 N 超过了客户端设置的连接超时时间,请求将在客户端失败。
我无法理解 Tomcat 的 connectionTimeout
有何不同。具体来说,"after accepting a connection, for the request URI line to be presented" 是什么意思?
connectionTimeout
是服务器将自动关闭与客户端的连接的时间限制,而不是相反。这是一种限制 Denial Of Service Attack 影响的方法。实际上,进行 DOS 攻击 的典型方法是在给定服务器上启动多个请求,每个请求将永远持续下去,使服务器无所事事地等待并填满其线程池,这样服务器将无法接受任何新请求。由于此超时,x 毫秒后它将忽略请求,将其视为潜在攻击。
Here 是关于全球同一主题的有趣讨论,而且讨论更深入。