Goodbye, Apache; hello, lighttpd!

Fed up with how Apache memory usage grows (and grows, and grows), I’ve changed all of my sites on my external server (where, for instance, this very blog is hosted) to lighttpd, a.k.a. Lighty.

I began by changing the most problematic site to Lighty (listening on port 81), and using Apache’s proxy module to redirect it there. After the results were promising, I went and changed each site at a time, dealing with the particular problems of each (I use lots of redirects, and the syntax is a bit different, and, furthermore, Lighty doesn’t support .htaccess files.

WordPress was relatively easy (just one line). MyBB would have been even easier (nothing to do), if not for the fact that I use an SEO mod which uses an .htaccess file for nicer URLs. But everything was easier than I expected.

After each site had been “moved”, it was just a matter of stopping Apache and moving Lighty to port 80.

Memory usage is way down, and so is swap file usage (basically, it’s not being used, and it was, before — a lot). Barring any future problems, I’m quite happy with this set-up, and would advise this change to anyone who’s never tried anything other than Apache on an Unix system. I’ll probably try doing the same thing on my home server, too.

Tags: , , , ,

4 Responses to “Goodbye, Apache; hello, lighttpd!”

  1. Alcides says:

    Is there any how to make lighttp read the htaccess? I’ve seen a module that does the same for IIS, just wondering…

    Without that, most of my apps wont run :/

  2. Not that I know of. I’ve had success converting .htaccess files to directives in the lighttpd config file, but, of course, that won’t work for apps that change their own .htaccess file…

  3. Been down this path, and eventually returned to Apache. Apache modules are just too powerful not to miss them in lighty. My final setup, which I shall eventually describe in my blog, is a streamlined frontend apache, running the new event MPM, and a backend apache with the prefork MPM and all bells and wistles. Each server can handle a couple million pageviews per day, with peaks of 30 frontend processes and 5 backend processes. Under static content request loads, servers can easily serve ten times this load with no stress. Frontend processes average about 15Mb RSS usage.

    Bonus with this setup: mod_rewrite (the real voodoo one, not lighty’s stripped version) and the fabulous mod_cache. Oh, and a clean separation between static content and dynamic content servers.

  4. mic says:

    Hello, may you share how you converted the wordpress .htaccess file?


Leave a Reply