The role of HTTP keep-alive
Role: Keep-alive: The client-to-server connection continues to be valid, and when a subsequent request to the server occurs, the Keep-alive feature avoids establishing or re-establishing the connection. Web servers, which basically support HTTP keep-alive.
Cons: This feature is often useful for websites that provide static content. However, for heavier web sites, while retaining open connections for customers has some benefits, it also affects performance because the resources that could have been freed during the processing pause are still occupied. When the Web server and application server are running on the same machine, the Keep-alive feature has a particularly significant impact on resource utilization.
Solution: Keep-alive:timeout=5, max=100
Timeout: The expiration time is 5 seconds (the parameter in the corresponding httpd.conf is: keepalivetimeout), Max is a maximum of 100 requests, forcing the connection to be disconnected. is a new connection in timeout time, and Max will automatically minus 1 until 0, forcing it to break.
The role of HTTP keep-alive