什么是 Web 服务器端超时?

what is web server side timeout?

我知道如果在定义时间没有建立连接,http 客户端将连接超时。还有一个读取超时,就是服务器端发送第一个字节响应字节之前的时间。

现在我的问题是服务器将发送响应代码为 408 的超时响应。这到底是什么意思?什么情况会导致服务器发送408? Linux 上的底层机制套接字超时是什么? Web 服务器如何检测超时?

提前致谢!

408 status code indicates that the server would like to shut down an unused connection with the client. It's defined in the RFC 7231:

6.5.7. 408 Request Timeout

The 408 (Request Timeout) status code indicates that the server did not receive a complete request message within the time that it was prepared to wait. A server SHOULD send the "close" connection option in the response, since 408 implies that the server has decided to close the connection rather than continue waiting. If the client has an outstanding request in transit, the client MAY repeat that request on a new connection.