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.

Related posts:

  1. Apache 2.2.0 is out

Tags: , , , ,

7 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 blog.com 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?
    Thanks!

    mic

  5. I constamment passé ma demi-heure à lire
    ce site web l ‘ articles tout le temps avec une tasse
    tasse de café .

  6. It’s in fact very complicated in this active life to listen news on TV, so I
    only use web for that purpose, and take the newest news.

  7. Oh my goodness! Amazing article dude! Thanks, However I am having difficulties with your RSS.

    I don’t know the reason why I cannot subscribe to it. Is there anybody having similar
    RSS problems? Anyone that knows the answer will
    you kindly respond? Thanks!!

Leave a Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.


Creative Commons Attribution-NonCommercial-NoDerivs 2.5 Portugal
This work by Pedro Timóteo is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 2.5 Portugal.