LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Query regarding performance-differences, in using a "servlet" VS "PHP module" (https://www.linuxquestions.org/questions/linux-newbie-8/query-regarding-performance-differences-in-using-a-servlet-vs-php-module-4175472786/)

ajaygarg 08-09-2013 11:04 AM

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/servle...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.....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

j-ray 08-11-2013 06:03 AM

For highly frequented websites it saves you hardware costs if you use servlet technology. If you run a website with only a couple thousand users you are probably better off with a php or ruby solution (as development costs are lower).
Of course I am strongly generalizing. It's a rule of thumb only.


All times are GMT -5. The time now is 12:33 PM.