Apache not multithreaded?

I have been using Apache lounge for more than 3 months on localhost. Today I discovered that my Apache / PHP installation is not multithreaded by running a script that uses sleep (10) and simultaneously opens two browser tabs. (the second tab loads 10 seconds after the first run).

I installed Apache (version of apache.org) and nothing has changed. I am using PHP 5.3.6. Safe Stream VC9.

What is the problem?

+4
source share
3 answers

You must ensure that you are using an Apache MPM worker, not a pre-sale one. Depending on your installation, you can simply symbolically associate / usr / sbin / httpd 2 with / usr / sbin / httpd2-worker (or where it is installed).

Of course, in your case, you can also simply increase the number of maximum processes in your configuration, which should allow you to open several tabs and start them simultaneously.

Something like that:

StartServers 2 MinSpareServers 2 MaxSpareServers 8 ServerLimit 8 MaxClients 8 KeepAlive off 
0
source

I had the same problem. I am sending requests from 3 browser tabs from Chrome to one local script with sleep(4) , and the responses were waiting for each other. But I checked that if I sent one from Chrome and the second from Firefox, this situation does not reproduce

0
source

It looks like you are bumping into a browser function: Background tabs only load when you switch to this tab; this is the current default value for many browsers (check your settings or use two different browsers to check). Yours faithfully: -)

0
source

All Articles