I have a web app hosted in a cloud environment which can be expanded to multiple web-nodes to serve higher load.
What I need to do is to catch this situation when we get more and more HTTP requests (assets are stored remotely). How can I do that?
The problem I see from this point of view is that if we have more requests than mongrel cluster can handle then the queue will grow. And in our Rails app we can only count only after mongrel will receive the request from balancer..
Any recommendations?
I would start with an
around_filtermaybe something like:Use this as a starting point. Hope that helps.
Edit: put this code in the ApplicationController so it can be used by every Controller.