toofishes.net

Why I switched from lighttpd to nginx

I switched my personal VPS server (the guy you’re reading this blog from) from lighttpd to nginx today after getting fed up with some lighttpd behavior one too many times. It comes down to memory usage, and although my 512 MB Linode has more memory than my 256 MB Slicehost did, it is still not unlimited.

Freckle Pulse Screen

Lighttpd makes a big deal of their non-blocking architecture. That is super cool, until someone, usually a web crawler, clicks a cgit link to an image file in git and it bloats your lighttpd process to 400 MB or more, leading to memory graphs like the one shown here. Cause? The difference between the bandwidth in the input/output pipes; cgit is producing output much quicker than it can be sent to the client, so it all backs up in lighttpd’s memory, which later has a hard time getting freed. So much for being lighter weight than Apache.

Exhibit 1 is a link such as a cgit tree view. (I used to link to an example when I ran cgit; I no longer run cgit on this server.) This would have made my VPS unhappy before; nginx exhibits much safer and reasonable behavior when huge files like this are generated.

Tags

See Also