We are building a web based game on a LAMP stack, but it could just as
be on a LEMP stack. The game does not involve a lot of typical game
character movement, etc. - like in most video games. Instead, it
some video clips and some html pages, with updates to content and chat
supplied primarily using Ajax and jQuery. You can think of it like the
‘Are you smarter than a 5th grader’, but this is an HTML5 web-based
application, not an app you download, and it has much more variety and
I’ve read that nginx is much better for static web pages and that apache
better for processing on the back end. Can anyone provide some guidance
to why it would be better to switch to nginx from apache for this type
I’ve read that nginx is much better for static web pages and that
apache is better for processing on the back end.
I’m using OpenResty, and I would say that it gives me more performance
than Apache (as an app server) would in ANY configuration. Possibly by a
factor of 10-40, though I haven’t actually done an apples-to-apples
benchmark – and I’m also using LuaJIT now instead of PHP, so that’s a
HUGE speed advantage by itself (Lua being the FASTEST dynamic language
around, and PHP being one of the slowest).
I’ve heard of people getting 70k+ concurrent connections per second
using Lua (or LuaJIT maybe) and OpenResty. My low-end VPS can’t handle
that many connections, but it easily handles 3k+ connections per second,
including complex app logic.
At this point for the beta, I’m using PHP - could switch to something
like Lua for a future production version. My best course for right now
might be to use nginx on the front end and apache on the back end; could
extend nginx to OpenResty, and could possibly use Varnish as well.
Anyone with experience in these areas, please comment.
we run nginx as frontend (caching/loadbalancing/waf-functions via naxsi)
front of different setups
(rails, tomcat, apache+php) and can recommend it, esp. the
if used with caution,
might be integrated in parts of your application.
i’ll give a talk on this topic on an oss-conference soon and will
paper with benchmarks
and different implementations of nginx as frontend-gateway.