6 ms·
I am currently using Apache and its the only web server I ever used, I have looked in to Lighttpd and Nginx but never actually used it. Can anyone tell me why I
by pavs 16y ago
I am currently using Apache and its the only web server I ever used, I have looked in to Lighttpd and Nginx but never actually used it. Can anyone tell me why I should use the other two over Apache? The main reason I am using Apache because it has a large user base, community and documentation that I can rely on if I ever need any help.
- ErrantX 16y agoLighty/Nginx are, I found, "nicer" in general. Easier to configure, can handle high loads with a lot less resources, more verbose configuration. All 3 are a reasonable choice though.
- bnoordhuis 16y agoCan't vouch for lighty (though I suppose the same applies) but nginx is much, much faster than Apache. nginx was designed with speed in mind, Apache with reliability[1] and extensibility. [1] Apache's internal API is designed to make it difficult to leak memory or other resources, overrun buffers, etc.
- bmelton 16y agoThe main reason I switched to Nginx is that it uses dramatically less memory than Apache. Running a semi-popular message board, I was eating through 4Gb of memory between Apache and MySQL on Ubuntu, and simply switching over to Nginx was faster and freed up over 1Gb of allocated memory immediately. Since then, I've grown to dramatically prefer its configuration file syntax and usability.
- AdamN 16y agoThe configuration file for Nginx is much simpler.
- JoachimSchipper 16y agoBut note that Apache's memory use (and overal slowness) depends a lot on what modules you use. mod_{php,perl,...} embeds a whole interpreter in each Apache process, which causes lots of overhead, but you don't have to use these.
- jrussbowman 16y agoI switched to nginx because it was leaner than apache, and the specific use case I had for it was load balancing (and eventually proxy caching) and static content. Apache is great because of the amount of options it has, it's the swiss army knife of web servers. However, if you really don't need your web server to do a lot, I've found that other systems are a more efficient choice, especially when you're trying to squeeze a lot out of small VPS machines.
- steveklabnik 16y agoTo add to the responses below, my sites are done with Rails, which tends to want to do things inside of Rails itself, rather than use features of the web server. All I want out of a server is to manage incoming requests and route them to Unicorn. So the large featureset of Apache is a downside, and the leanness of nginx is an upside.
- slowpoison 16y agoWhen choosing between Apache and Nginx (or others), it's not really an apples-to-apples comparison, so you better look at the feature-set carefully before you choose to move. Apache has tons of features and has a great ecosystem around it, which means it can do a lot more to help you generate the content you need - e.g. server-side processing. Nginx is more geared towards high-performance, yet simpler content serving needs. Identify your needs, and then choose. In a nutshell, if you are using mod_php, mod_perl or any of the esoteric modules with Apache in your current installation, I think staying with httpd is a better idea. If you are facing performance problems, you could use Nginx as a reverse-proxy.