Server Woes
Posted by Skip Fri, 14 Apr 2006 01:35:00 GMT
We have been having a lot of issues with keeping our lighttpd sites up and running on TextDrive (even with a @reboot cron job set). There is a ruby script called daedalus that can continually check for your lighttpd process, and if it’s not found attempt to restart it, but due to overuse the TextDrive admins banned it from their servers.
We decided that the easiest thing to do was just use Ruby’s own Net::HTTP module to request the headers for our blog every 10 minutes or so. If we don’t get back a ‘HTTP 200’ we know something’s wrong and run a shell script that SSHs into our server and restarts lighttpd. Since we’re just requesting the headers the bandwidth won’t be a problem and the resource load on TextDrive is no more than a regular web request.
If you’d like to use it for yourself, feel free.

