You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Chidanand Gangur <ch...@gmail.com> on 2007/05/10 13:23:16 UTC

[users@httpd] How is PHP script executed in apache

Hi,

I have compiled PHP as module in apache. Recently I have noticed a strange
problem when apache executes the PHP script.

My assumption till date:

1. If there are number of request destined to the same/different PHP page
then apache will spwan child process to handle the load.
2. If two requests are sent simultaneously on same page then apache module
will process those two requests parallely with two different child threads.

Am I right on my assumptions?

1. In my test I have x.php which talks to a backend modules
2. I send some request to x.php which inturn lands on the backend module(1)
through sockets.
3. Mean while when backend module(1) is busy in processing, another request
arrives on the x.php.
4. This request  is destined to backend module (2)

My observation here is the response from the backend module( 2) is blocked
till the response from backend module( 1) is completed.
whereas as per my assumption apache shoud have processed these two requests
in two different threads/child process without blocking.

Is this expected behaviour? what should I do to get parallelism.
I would like to know more about how the php scripts are processed in apache,
can some one guid me to a useful link.

--
Thanks,
Chidanand Gangur
Pune.

Re: [users@httpd] How is PHP script executed in apache

Posted by Joshua Slive <jo...@slive.ca>.
On 5/10/07, Chidanand Gangur <ch...@gmail.com> wrote:

>  My observation here is the response from the backend module( 2) is blocked
> till the response from backend module( 1) is completed.
>  whereas as per my assumption apache shoud have processed these two requests
> in two different threads/child process without blocking.
>
>  Is this expected behaviour? what should I do to get parallelism.
>  I would like to know more about how the php scripts are processed in
> apache, can some one guid me to a useful link.

Apache does indeed process all requests in parallel. What you are
seeing is almost certainly the result of exclusive locking performed
by your php script or a library/module used by your php script.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org