views:

18

answers:

1

Hi,

I am working with a client who's server admin refuses to install monit or god on their webserver to restart locked or slow mongrels / threads as they reckon the application should just work flawlessly and threads should never lock / go slow.

Unfortunately their app makes a lot of calls to 3rd party webservices, many of which are slow, and their database is heavily un-optimized (I cannot access or push to change this) so there are a lot of slow AR queries causing timeouts.

Is it possible to actively monitor HTTP requests & if one gets passed to a slow / locked mongrel then re-direct it to an active one?

I know this may produce a slow response, but better slow than a connection timeout error.

Thanks!

A: 

You could install HAProxy or use nginx as a round robin load balancer, but really I suggest you skip those and install the Passenger gem available for Apache or nginx, the de facto Rails stack for a while now. You can also run Passenger in development (google for articles). I suggest you insist to the SysAdmin that Passenger is part of the application stack.

Andy Atkinson