Move high CPU site to lighttpd

I have a problem site on my server (it’s actually one of my own sites, so I can’t just kick it off :p), which uses most of the CPU power available to the server.

From what I’ve read on various websites, lighttpd is far better suited than Apache/httpd for high-volume websites.

For me to move my site to using lighttpd, I’ve noticed I need to do the following things:

  • Stop httpd listening on one of my IPs, and then move my problem site to that IP
  • Make lighttpd to log to ~/var/domain/logs/(transfer.log|error.log)
  • Get bandwidth monitoring working, somehow

How easy would those three things be to do? The first two look relatively easy, but I can’t see how to do the third…

I know lighttpd isn’t supported (yet), but are there any pointers you could give me? Especially for the third item in my list.

Edit: Done the first one, the second one should be easy enough, but I can’t see how IWorx gets the bandwidth stuff done :frowning:

Thanks! :slight_smile:

Well I’ve been using httpd with xcache for a couple months, which has helped, but now it’s starting to lose effect as my website gets more and more hits…

Can anyone give any ideas about this? I’m guessing IWorx gets bandwidth info from the log files…:

12.34.56.78 - - [DD/MMM/YYYY:HH:MM:SS +0000] “GET /path/to/requested/file.php HTTP/1.1” 200 20850http://referering.site.com/funky/page.php” “Mozilla Firefox 9.6.2.6.2.7 blah blah blah (the user agent)”

The bold number from that log line I’m guessing is the size? Does IWorx just add these up once a day?

You can modify the httpd.conf file and specify IP addresses to listen to by hand, and exclude the one you wanted to use for your site. That’s cake.

Configuring lighttpd should be cake too. I haven’t played with it much, so I don’t know how much control over log file formats you have. I also don’t know how IWorx is monitoring bandwidth but I’d bet that if you wrote to logs in the normal IWorx spots in the same format, you’d be well on your way to something smooth.

… Yes the bold number is the number of bytes sent in the response.

I have modified the httpd.conf already to exclude one of the IPs, but haven’t changed the DNS records to point at that IP, nor started lighttpd yet, as I need to have bandwidth monitoring working first.

Can someone from IWorx confirm whether or not the log files are used for bandwidth stuff? Thanks :slight_smile:

We use mod_watch to do realtime bandwidth monitoring. For httpd bandwidth, each domain has a mod_watch file in /var/lib/mod_watch. These files are managed solely by mod_watch, and not by us.

When the iworx.pex --fively runs, it reads each domain’s mod_watch file in that directory (e.g., /var/lib/mod_watch/domain.com), updates the RRD graphs and updates the internal iworx dbs accordingly.

However, the log files found in /home/username/var/domain.com/logs are used for the daily web stats processing (Analag, AWStats, Webalizer).

Ahh ok, thanks. I’ll see if there’s a mod_watch or similar for lighttpd :slight_smile:

Not sure this is what you need. (I have seen it on the hosting provider’s site; they don’t use iworx though, they use cpanel. And I guess this doesn’t matter here)

mod_bandwidth (beta) - A bandwidth tracking and limiting plugin for lighttpd
(asmallorange.com/products/opensource/mod_bandwidth.php)

[QUOTE=tiger;11838]Not sure this is what you need. (I have seen it on the hosting provider’s site; they don’t use iworx though, they use cpanel. And I guess this doesn’t matter here)

mod_bandwidth (beta) - A bandwidth tracking and limiting plugin for lighttpd
(asmallorange.com/products/opensource/mod_bandwidth.php)[/QUOTE]
Nice, Thanks tiger, I’ll check it out :slight_smile: