rate-limiting

How to limit rate of requests to web services in Python?

I'm working on a Python library that interfaces with a web service API. Like many web services I've encountered, this one requests limiting the rate of requests. I would like to provide an optional parameter, limit, to the class instantiation that, if provided, will hold outgoing requests until the number of seconds specified passes. I ...

What is the best way to implement a rate-limiting algorithm for web requests?

Possible/partial duplicates: What’s a good rate limiting algorithm? Throttling method calls to M requests in N seconds Best way to implement request throttling in ASP.NET MVC? I am looking for the best way to implement a moving time window rate limiting algorithm for a web application to reduce spam or brute force attacks. Examples ...

Rate limiting a ruby file stream

I am working on a project which involves uploading flash video files to a S3 bucket from a number of geographically distributed nodes. The video files are about 2-3mb each, and we are only sending one file (per node) every ten minutes, however the bandwidth we consume needs to be rate limited to ~20k/s, as these nodes are delivering str...

What's the best approach to rate limit an expensive operation with PHP & Memcached?

I came up with this: if($prog->memcache) { $r = $prog->memcache->get("ratelimit:{$_SERVER['REMOTE_ADDR']}"); if(!empty($r)) $prog->errorClose('This IP has been flagged for potential abuse.'); } foo(); // the thing we're rate limiting... if($prog->memcache) $prog->memcache->set("ratelimit:{$_SERVER['REMOTE_ADDR']}", 1, 0, ...

Rate Limiting Calls To an Api Using Cache in ColdFusion

Hi I am using ColdFusion to call the last.fm api, using a cfc bundle sourced from here. I am concerned about going over the request limit, which is 5 requests per originating IP address per second, averaged over a 5 minute period. The cfc bundle has a central component which calls all the other components, which are split up into secti...

How do I implement rate limiting in an ASP.NET MVC site?

I'm building an ASP.NET MVC site where I want to limit how often authenticated users can use some functions of the site. Although I understand how rate-limiting works fundamentally, I can't visualize how to implement it programatically without creating a major code smell. Can you point me towards a simple yet powerful solution for appr...

Limit the rate of requests to an API in a CGI script

The script that I'm writing sometimes makes requests to an API and the API requires that requests are limited to a maximum of 1 per second. What is the most straight forward way of limiting my requests to the API to 1 every second? Would it involve storing the current time in a file each time a request is made? ...

Memcache-based rate-limiting algorithm? (Token bucket?)

I'm looking for an efficient approach to rate-limiting request from Google App Engine to a third party service. The third party service rate limits requests on a per-account basis, and on the Google App Engine side, most of the work is carried out inside tasks. Token buckets are a great general algorithm here. Q: what approach can be ...

Stack Exchange API compliant request throttle implementation on Google App Engine Cloud inrastructure

I have been writing a Google Chrome extension for Stack Exchange (http://goo.gl/iWo0). It's a simple extension that allows you to keep track of your reputation and get notified of comments on Stack Exchange sites. Currently I've encountered with some issues that I can't handle myself. My extension uses Google App Engine as its back-end ...