Hmmm, me thinking...


On 4/21/06 7:03 PM, "Andre Nathan" <andre / digirati.com.br> wrote:

> Hello
> 
> I'm pleased to announce the release of Ruby/Watchcat 1.0.0.
> 
> Ruby/Watchcat is an extension for Ruby for the development of
> watchcatd-aware applications.
> 
> Watchcatd is a watchdog-like daemon in the sense that it takes actions
> in situations where a machine is under heavy load and/or unresponsive.
> However, watchcatd isn't as drastic as the usual watchdog systems, which
> reboot the machine. Instead, all it does is sending a signal to a
> registered process (which by default is SIGKILL) if the process doesn't
> send it a heartbeat before a user-specified timeout.

With Mongrel you've got the situation that a single Mongrel server could
potentially be handling many requests at once, so killing off a dead one
could really make things bad.  But, in a shared hosting environment this
would perfect for catching the poorly coded servers that eat up resources.

I kind of like this solution though since it is more difficult for the
person to cheat.  They can't really turn it off by injecting Ruby code since
they still have to talk to the watchcat.  I'm curious if they could cheat
other ways such as transferring the socket to another process which always
works.

On another note, you know there's options to for throttling and restricting
the number of active threads in Mongrel right?  -t will do a timeout (says
seconds in the docs but it's actually 1/100th of a second) between each
socket accept.  -n will make sure the number of processor threads doesn't go
above a given limit.

Zed A. Shaw
http://www.zedshaw.com/
http://mongrel.rubyforge.org/