views:

83

answers:

2

I'm using an AMP server (Apache 1.3, MySQL 5.0, PHP 5.1.5) which I have found to only allow 1 connection/request per browser at one time. The easiest way to reporduce this is to request a large download which is passed through PHP and try to access another page at the same time. You will end up waiting for the first request (the file download) to complete before the other page loads.

I'm not sure if the problem is Apache, MySQL or PHP. Any ideas where I should start looking?

I can make other requests through other browsers on the same computer.

A: 

I would start looking in the apache config. MaxClients might be set to 1?

PEZ
MaxClients is set to 500.
Darryl Hein
+1  A: 

If you are using PHP Sessions then this could be caused by the session file being locked. To prevent the session file from being corrupted by simultaneous writes, only one script per session can be running at once. This means subsequent requests will have to wait until the first has ended.

The session is written automatically when a script terminates, but you can make this happen earlier by calling session_write_close(). If you are writing a script that is going to take a while to run it would be wise to call this as soon as you no longer need access to the session data.

There is some explanation of this in the documentation here

Tom Haigh