Should I use nginx exclusively, or have it as a proxy to Tomcat (performance related)?

Posted by Kevin on Server Fault See other posts from Server Fault or by Kevin
Published on 2011-03-06T02:55:27Z Indexed on 2011/03/06 8:11 UTC
Read the original article Hit count: 236

Filed under:
|
|
|
|

I've planned to create a website that'll be pretty heavy on dynamic content, and want to know what would be the wisest choice for part of my webstack.

Right now I'm trying to decide whether I should develop upon nginx, using PHP to deliver the dynamic content, or use nginx as a proxy to Tomcat and use servlets to deliver the dynamic content.

I have a good amount of experience with Java, JSP, and servlets, so that's a plus right off the bat. Also, since it is a compiled language, it will execute faster than PHP (it is implied here that Java is around 37x faster than PHP) , and will create the web pages faster.

I have no experience with PHP, however i'm under the impression that it is easy to pick up. It's slower than Java, but since the client will only be communicating with nginx, I'm thinking that serving the dynamically created web pages to the client will be faster this way.

Considering these things, i'd like to know:

  1. Are my assumptions correct?
  2. Where does the bottleneck occur: creating pages or serving them back to the client?
  3. Will proxying Tomcat with nginx give me any of nginx performance benefits if I'm going to be using Tomcat to generate the dynamic content (keeping in mind my site is going to be heavy in this aspect)?

I don't mind learning PHP if, in the end, its going to give me the best performance. I just want to know what would be the best choice from that standpoint.

© Server Fault or respective owner

Related posts about php

Related posts about nginx