1. Overview
Some sites will be down after the server has been running for a period of time, there are many reasons for this phenomenon: such as Tomcat heap and non-heap memory settings are insufficient,
The program failed to free up memory space causing memory overflow, or some processes have not been able to release, resulting in a large consumption of CPU resources.
But in addition to the program itself, there may be customer service side access caused (of course, the client also contains such as Spider software Search engine),
If the server and client establish a long link (you can use the "netstat-a" command to view network access information), this requires the HTTP response header
Connection to make certain settings.
A Connection header field may appear in the request and Reponse headers in http1.1, which means that when the client
How long links are handled when communicating with the server.
In http1.1, both the client and server are the default side support long links, if the client uses the HTTP1.1 protocol, but do not want to use
Long link, you need to indicate in the header that the value of connection is close, and if the server side does not want to support long links, in response
It is also necessary to explicitly state that the value of connection is close.
A connection with a value of close is included in the header of either request or response, indicating that the TCP link currently in use is in the request
It will be cut off after processing is completed. A new TCP link must be created in the future when the client makes a new request.
The close setting of the HTTP connection allows either the client or the server to close the underlying connection both sides will require that after processing the request
Close their TCP connections.
2. Example
Connection:keep-alive
Connection:close
The above introduces the PHP knowledge Point 3-http head-connection, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.