Description: in PHP, when the same client executes two pages containing session_start (), the session file will be blocked if execution takes a long time to execute first. The specific performance is: A PHP page execution time is relatively long, and as long as the page is not completed, the other page access is a long time loading state, only the page execution is complete, the rest of the page to open.
Reason: PHP By default is stored in a file format session, for each request to execute a page containing session_start (), the default is to create a file containing session_id, and the file will be locked, If the user in this client and access to a page containing session_start (), as session_id, this page will also read the user stored session file, if the first page is not completed, the file has been locked, The second page cannot be obtained and can only be in a waiting state.
Possible consequences: If the site has a large number of user access, so that the session read file has been blocked waiting, the user browser has been maintained and the server connection, which will consume a lot of server resources. Also, as the number of active connections to the Web server increases, the connection resources may be exhausted, resulting in a denial of service behavior.
Workaround: I recommend using the Redis storage session compared to using the database storage session. Read and write speeds can be significantly improved compared to files and databases, and multi-server sharing is possible.
PHP Session Lock