Questions tagged [throttling]

Throttling is a mechanism to regulate the rate at which processing is performed

1092 questions
7
votes
2 answers

What are common ways of implementing web API request throttling/rate-limiting?

What are common ways of implementing web API request throttling? Are there any libraries for common web frameworks (Rails, Django, Java, etc.) that give you this along with temporary banning? A related question suggests that the rate limiting is…
Ken Liu
  • 22,503
  • 19
  • 75
  • 98
7
votes
0 answers

Which throttling implementation to use?

I'm implementing a throttling mechanism to limit the amount of web requests sent to a server. If there are too many submissions for a request then the extra requests are queued until the resource becomes available. There seems to be many throttling…
blue-sky
  • 51,962
  • 152
  • 427
  • 752
7
votes
4 answers

Whose responsibility is it to throttle web requests?

I am working on a class library that retrieves information from a third-party web site. The web site being accessed will stop responding if too many requests are made within a set time period (~0.5 seconds). The public methods of my library directly…
Justin Rusbatch
  • 3,992
  • 2
  • 25
  • 43
7
votes
1 answer

API Throttling Best Practices

I have a SOAP api that I would like to throttle access to on a User basis after "x" many calls have been received in "y" amount of time. After searching around, the #1 consideration (obviously) is to consider your parameters for when to throttle…
alph486
  • 1,209
  • 2
  • 13
  • 26
7
votes
3 answers

Distributed rate limiting

I have multiple servers/workers going through a task queue doing API requests. (Django with Memcached and Celery for the queue) The API requests are limited to 10 requests a second. How can I rate limit it so that the total number of requests (all…
RS7
  • 2,341
  • 8
  • 34
  • 57
7
votes
8 answers

throttle requests in Node.js

I have an array. I can loop over it with the foreach method. data.forEach(function (result, i) { url = data[i].url; request(url); }); The request function is making a http request to the given url. However making all these requests at…
saeed
  • 3,861
  • 3
  • 25
  • 23
6
votes
2 answers

Throttling POST requests in rails application

I'm using rack-throttle as a rate-limiting engine in my rails 3 application. I've created my own class based on the Rack::Throttle::Interval to define custom rate limiting logic. I'm checking if the request is made to exact controller and exact…
roman
  • 5,100
  • 14
  • 44
  • 77
6
votes
2 answers

Throttling requests by IP address on Apache?

I want to throttle requests to my web server so as to thwart web scraping and denial of service attacks against my site. I'm willing to be relatively lax, the key thing is that no one requests so much so as to slow things down. I was thinking of…
Ben G
  • 26,091
  • 34
  • 103
  • 170
6
votes
1 answer

How does the Throttle publisher work in Swift Combine?

I'm stuck with Throttle publisher. I don't understand the way it picks intervals. Debounce publisher is much easier to understand, it picks an interval after each published value and checks whether new values are posted during the interval or not.…
iWheelBuy
  • 5,470
  • 2
  • 37
  • 71
6
votes
1 answer

Laravel API exclude 1 ip address from rate limiting

On a Laravel API I've set rate limits using the default middleware for throttling; Route::group(['prefix' => 'products'], function() { Route::get('/', ['as' => 'products.index', 'uses' =>…
Martijn
  • 509
  • 6
  • 23
6
votes
1 answer

When is the 'remaining > wait' conditional statement ever true in underscore.js's implementation of throttle?

Library code (line 860 in question): https://github.com/jashkenas/underscore/blob/master/underscore.js if (remaining <= 0 || remaining > wait) When is the second half of this true? Background - first post on SO and pretty new to javascript coding. …
6
votes
2 answers

How can I reduce the impact of a long-running i/o-intensive query in PostgreSQL?

This post suggests I can use a cursor to fetch from a query at a throttled rate. How do I do this? My aim is to reduce the impact of this low-priority query on other higher-priority queries.
jl6
  • 6,110
  • 7
  • 35
  • 65
6
votes
2 answers

Laravel Throttle message

I'm using ThrottleRequest to throttle login attempts. In Kendler.php i have 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, and my route in web.php Route::post('login', ['middleware' => 'throttle:3,1', 'uses' =>…
hayumi kuran
  • 391
  • 9
  • 21
6
votes
1 answer

Laravel: different api rate limits for different paths

I need to setup different rate limits for different paths. Foe example: On path /users I want to have rate limit of 60 requests per minute, while for path /stats I want to have rate limit of only 5 requests per minute. I tried with next…
Sufi
  • 63
  • 1
  • 5
6
votes
2 answers

Twilio queue overflow error: how large is the queue?

Twilio's Message resource has a "status" property that indicates whether a SMS message is "queued", "sending", "failed", etc. If a Message instance failed to deliver, one possible error message is "Queue overflow". In the Twilio documentation, the…
Emily Chen
  • 247
  • 1
  • 3
  • 8