Experience in migrating from Apache to nginx?

Solution 1:

In my experience, it is well worth it. Take for example, a Magento store (which is well known for being slow in general). I was able to get an over 100% improvement in response time by switching to nginx + php-fcgi/php-fpm + apc. At this point, unless there is a must have feature in Apache that is not available elsewhere (I doubt this will really happen in practice), I would always go with an nginx based config.

Here's my writeup for Magento. HTH. http://tumblelog.jauderho.com/post/85252024/improving-magento-performance

Solution 2:

All of the features you list are supported by Nginx out of the box:

  • Multiple Virtual Hosts
  • Server-Side Includes
  • FastCGI

We use a gross combination of Lighttpd, Apache and Nginx at work. We can't get rid of Apache entirely because we're running a couple custom modules for it (a hacked mod_pubcookie, among others) and it'd be a pain to port them over to Lighttpd/Nginx.

I used to use Lighttpd as our de-facto lightweight content server, but have hit numerous snags with its FreeBSD implementation (it seems to break when using FreeBSD's sendfile/kqueue syscalls - and when it breaks it takes the whole server down with it). I've never had any issues with Nginx, and have been slowly replacing all our Lighttpd installs with it. Nginx has been rock solid in our deployment.

The one issue that I have had with Nginx is that its documentation isn't well-indexed by Google, so you have to go directly to their site to look up stuff. Despite that, all the documentation is organized in a manner which makes sense to me, so it's not too hard to find what I need.

Solution 3:

I'm afraid I don't have experience of nginx, only apache and lighttpd. We replaced 110 copies of apache running as different users for customer PHP applications with a single instance of lighttpd and 110 PHP processes connected via FastCGI. The configuration was considerably less, memory usage lower and probably faster. In this particular instance, the PHP applications weren't directly accessible via the internet. I'm uncertain as to whether we would do that. We know what we're doing with Apache; we've had a lot of experience with it. I My impressions are that Apache is very flexible, but you pay for that with a larger slower process. I'd use lighttpd and nginx where we didn't need that flexibility. I appreciate this probably hasn't really answered your question.