Reputation: 11688
Along the last years i used Apache httpd server for my servers.
As i understand it - the biggest advantage in using Nginx is that Apache opens a different Thread for each HTTP request - which might load my server very quickly, while Nginx uses some other technique (Event driven) in order to take the maximum out of my server's memory and hardware.
So far so good.
I'm building a new web service which i expect to have lots of HTTP traffic so i've decided to use Nginx.
As a good Java programmer i like Java more than PHP but i have a concept problem using it in my case:
In all the post I've found that the way to use Java on it is to wrap the application with Nginx + Tomcat (or other JavaServer) + Java - so, if i understand correctly - i will not get the Nginx advantage since the Tomcat will open a new thread for each request in order to use the Java web service.
Questions:
Upvotes: 0
Views: 325
Reputation: 571
Upvotes: 1
Reputation: 42899
Yes you got it correctly, what you're doing here is putting an extra layer above the tomcat, so you'll not get the advantage, the only advantage that you'll get is serving assets ( images and static files ) without passing them to the apache, which might give a slight advantage.
Why php is has this advantage: because when using nginx instead of running php as a module of apache (mod_php) we install a separate server php-fcgi or php-fpm, so it's independent of apache's method of spawning workers or threads or whatever.
Upvotes: 0