views:

146

answers:

2

Trying to Google around for an a Rails plugin that will allow for throttling the amount of requests a particular resource gets consumed. Django's Piston has some open source code for this. Is there something available out of the box for Rails or is it safe to assume that looking at how Piston does it and porting it as a Rails plugin is something that can be worked on?

+2  A: 

Here's some rack middleware that accomplishes what you're after: http://github.com/dambalah/api-throttling

and here's a blog post about the development of that middleware: http://blog.messagepub.com/2009/05/05/how-to-rack-middleware-for-api-throttling/

semanticart
A: 

There's a SO thread here about why you might want to rate limit outside your application. Food for thought, at least. I'm looking for this solution myself, and am up in the air whether I want to do it in the application layer.

JohnMetta