Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

Query regarding performance-differences, in using a "servlet" VS "PHP module"

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


ajaygargnsit at gmail

Aug 9, 2013, 8:57 AM

Post #1 of 5 (27 views)
Permalink
Query regarding performance-differences, in using a "servlet" VS "PHP module"

Hi all.

I was just doing some rudimentary research on what would be the best
solution to implement server-side operations of our webapp.
The "servlet" and "PHP" seem two widely used solutions.


However, there is one important thing that struck me.

Looking at http://www.tutorialspoint.com/servlets/servlets-life-cycle.htm,
it states that every new client-request to a servlet, spawns a new thread.
On the other hand, looking at
http://php.net/manual/en/internals2.structure.lifecycle.php, it states that
the Apache module MIGHT map different requests to a single process (with
the CGI model DEFINITELY using the one-process-per-request implementation).

Looking at the above, it seems that using Apache Tomcat to host a servlet,
is better than running a PHP module in Apache (as far as
resource-requirements are concerned at the server).

Is my understanding correct?



I will be grateful to any clearances on my doubts :)


Regards,
Ajay


covener at gmail

Aug 9, 2013, 9:27 AM

Post #2 of 5 (25 views)
Permalink
Re: Query regarding performance-differences, in using a "servlet" VS "PHP module" [In reply to]

On Fri, Aug 9, 2013 at 11:57 AM, Ajay Garg <ajaygargnsit [at] gmail> wrote:
> Hi all.
>
> I was just doing some rudimentary research on what would be the best
> solution to implement server-side operations of our webapp.
> The "servlet" and "PHP" seem two widely used solutions.
>
>
> However, there is one important thing that struck me.
>
> Looking at http://www.tutorialspoint.com/servlets/servlets-life-cycle.htm,
> it states that every new client-request to a servlet, spawns a new thread.
> On the other hand, looking at
> http://php.net/manual/en/internals2.structure.lifecycle.php, it states that
> the Apache module MIGHT map different requests to a single process (with the
> CGI model DEFINITELY using the one-process-per-request implementation).
>
> Looking at the above, it seems that using Apache Tomcat to host a servlet,
> is better than running a PHP module in Apache (as far as
> resource-requirements are concerned at the server).
>
> Is my understanding correct?

It's not a point of differentation. You can run either technology many
different overlapping ways.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


ajaygargnsit at gmail

Aug 9, 2013, 10:02 AM

Post #3 of 5 (26 views)
Permalink
Re: Query regarding performance-differences, in using a "servlet" VS "PHP module" [In reply to]

Thanks Eric for the reply.

So, is it possible to run PHP in Apache, with each client-request being
serviced in a different thread (and not a new-process-per-new-request)?
Because, it is a well known fact that a process is a much-higher entity
than a thread.

If not, Apache-Tomcat looks to be clear winner over PHP-in-Apache (please
correct me if I am wrong) :)

Please, I must say at the outset that I am not in favour, or against any
technology, but just wish to gauge some inputs on Apache internals, from
the Apache experts :)


On Fri, Aug 9, 2013 at 9:57 PM, Eric Covener <covener [at] gmail> wrote:

> On Fri, Aug 9, 2013 at 11:57 AM, Ajay Garg <ajaygargnsit [at] gmail> wrote:
> > Hi all.
> >
> > I was just doing some rudimentary research on what would be the best
> > solution to implement server-side operations of our webapp.
> > The "servlet" and "PHP" seem two widely used solutions.
> >
> >
> > However, there is one important thing that struck me.
> >
> > Looking at
> http://www.tutorialspoint.com/servlets/servlets-life-cycle.htm,
> > it states that every new client-request to a servlet, spawns a new
> thread.
> > On the other hand, looking at
> > http://php.net/manual/en/internals2.structure.lifecycle.php, it states
> that
> > the Apache module MIGHT map different requests to a single process (with
> the
> > CGI model DEFINITELY using the one-process-per-request implementation).
> >
> > Looking at the above, it seems that using Apache Tomcat to host a
> servlet,
> > is better than running a PHP module in Apache (as far as
> > resource-requirements are concerned at the server).
> >
> > Is my understanding correct?
>
> It's not a point of differentation. You can run either technology many
> different overlapping ways.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>
>


--
Regards,
Ajay


ajaygargnsit at gmail

Aug 9, 2013, 10:09 AM

Post #4 of 5 (25 views)
Permalink
Re: Query regarding performance-differences, in using a "servlet" VS "PHP module" [In reply to]

On Fri, Aug 9, 2013 at 10:32 PM, Ajay Garg <ajaygargnsit [at] gmail> wrote:

> Thanks Eric for the reply.
>
> So, is it possible to run PHP in Apache, with each client-request being
> serviced in a different thread (and not a new-process-per-new-request)?
> Because, it is a well known fact that a process is a much-higher
>

Sorry, I meant a "much-heavier (resource-consumption wise)"




> entity than a thread.
>
> If not, Apache-Tomcat looks to be clear winner over PHP-in-Apache (please
> correct me if I am wrong) :)
>
> Please, I must say at the outset that I am not in favour, or against any
> technology, but just wish to gauge some inputs on Apache internals, from
> the Apache experts :)
>
>
> On Fri, Aug 9, 2013 at 9:57 PM, Eric Covener <covener [at] gmail> wrote:
>
>> On Fri, Aug 9, 2013 at 11:57 AM, Ajay Garg <ajaygargnsit [at] gmail>
>> wrote:
>> > Hi all.
>> >
>> > I was just doing some rudimentary research on what would be the best
>> > solution to implement server-side operations of our webapp.
>> > The "servlet" and "PHP" seem two widely used solutions.
>> >
>> >
>> > However, there is one important thing that struck me.
>> >
>> > Looking at
>> http://www.tutorialspoint.com/servlets/servlets-life-cycle.htm,
>> > it states that every new client-request to a servlet, spawns a new
>> thread.
>> > On the other hand, looking at
>> > http://php.net/manual/en/internals2.structure.lifecycle.php, it states
>> that
>> > the Apache module MIGHT map different requests to a single process
>> (with the
>> > CGI model DEFINITELY using the one-process-per-request implementation).
>> >
>> > Looking at the above, it seems that using Apache Tomcat to host a
>> servlet,
>> > is better than running a PHP module in Apache (as far as
>> > resource-requirements are concerned at the server).
>> >
>> > Is my understanding correct?
>>
>> It's not a point of differentation. You can run either technology many
>> different overlapping ways.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe [at] httpd
>> For additional commands, e-mail: users-help [at] httpd
>>
>>
>
>
> --
> Regards,
> Ajay
>



--
Regards,
Ajay


covener at gmail

Aug 9, 2013, 11:19 AM

Post #5 of 5 (20 views)
Permalink
Re: Query regarding performance-differences, in using a "servlet" VS "PHP module" [In reply to]

On Fri, Aug 9, 2013 at 1:09 PM, Ajay Garg <ajaygargnsit [at] gmail> wrote:
>
>
>
> On Fri, Aug 9, 2013 at 10:32 PM, Ajay Garg <ajaygargnsit [at] gmail> wrote:
>>
>> Thanks Eric for the reply.
>>
>> So, is it possible to run PHP in Apache, with each client-request being
>> serviced in a different thread (and not a new-process-per-new-request)?
>> Because, it is a well known fact that a process is a much-higher
>
>
> Sorry, I meant a "much-heavier (resource-consumption wise)"
>
>

Running mod_php in a threaded webserver is out of favor, but it's
possible. You can also run a single-threaded webserver with PHP
embedded in it, or a pool of php processes waiting for fastcgi
connecitons. See php-fpm.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.