php - Why does apache not process multiple requests from the same browser simultaneously
Get the solution ↓↓↓Solution:
Are you using file-based sessions? PHP will lock session files for each request and maintain that lock until you do asession_write_close()
or the script terminates/exits. The side effect of this is that all requests become serial, since they're all contending for the same single resource (the session file).
Answer
Solution:
I am sure it's the session file. I have the same problem. I run a request that is long such as a PHPMyAdmin SQL insert which takes multiple minutes to process. While it is processing I try to open a new tab in the same browser and go to any page on my website and it will not go there until the original PHPMyAdmin request is done. If I open an incognito window in Chrome which is the same browser it works fine. If I open the website in any other browser it is fine. So it is probably the file based session which is the default for PHP.
Others have mentioned going to memcached. You could also save sessions in the database. Before having to go to memcached you could do all the session based stuff at the beginning. Copy the session variable into a temporary variable so you can close it then close it. And then if you need to set a session value later open it and make the change and then close it quickly.
Answer
Solution:
Can you point to evidence that it's apache? Unless your apache setup isn't optimal, most likely your page wait is something else, maybe you have set your ajax call to be non-async?
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: uncaught mysqli_sql_exception
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.