Questions tagged [rate-limiting]

Rate limiting is used to control the rate of traffic sent or received on a network interface.

Traffic that is less than or equal to the specified rate is sent, whereas traffic that exceeds the rate is dropped or delayed. Rate limiting is performed by policing (discarding excess packets), queuing (delaying packets in transit) or congestion control (manipulating the protocol’s congestion mechanism). Policing and queuing can be applied to any network protocol. Congestion control can only be applied to protocols with congestion control mechanisms, such as the transmission control protocol (TCP).

1053 questions
9
votes
1 answer

Does Lyft limits requests to their API for whole app?

There's an information in Lyft docs (https://developer.lyft.com/docs/rate-limits) that "Rate limits are global and are enforced on a per-client ID basis.". Is that really true? Lyft limits all requests based on client-id? For example POST to the…
Piotr Sękara
  • 710
  • 1
  • 5
  • 8
9
votes
2 answers

Non-blocking rate-limited ThreadPoolExecutor

I am hitting an HTTP server concurrently with multiple connections. I'd like to throttle the clients in response to servers indicating that requests are coming in too fast. I do not wish to change the HTTP library I am using but rather I'd like to…
Gili
  • 86,244
  • 97
  • 390
  • 689
9
votes
0 answers

Haproxy: Is there a way to queue incoming request?

Is there a way in HA-Proxy to queue incoming request. I am trying to throttle request based on certain rate limiting criteria, but my current implementation denies the request or blocks any new connection. This is a crude implementation at this…
Parag kale
  • 101
  • 1
  • 3
9
votes
1 answer

How to limit an Akka Stream to execute and send down one message only once per second?

I have an Akka Stream and I want the stream to send messages down stream approximately every second. I tried two ways to solve this problem, the first way was to make the producer at the start of the stream only send messages once every second when…
Phil
  • 46,436
  • 33
  • 110
  • 175
9
votes
7 answers

Rate limit a javascript function

How can I limit a function to only run 10 times per second, but continue execution when new "spots" are available? This means we'd call the function 10 times as soon as possible, and when 1 second has elapsed since any function call we can do…
Don P
  • 60,113
  • 114
  • 300
  • 432
8
votes
1 answer

Rate limiting to prevent malicious behavior in ExpressJS

Someone made me aware of some flaws in an application I'm working on (mostly within my JavaScript on the front-end), that leaves open the possibility of, say, clicking a ton of buttons at once and sending out a ton of transactional emails. This is…
Josh Smith
  • 14,674
  • 18
  • 72
  • 118
8
votes
1 answer

Distributed rate limiter for AWS lambda

I'm looking to services or solutions for distributed rate limiter for an application I'm building. These applications are concurrent AWS lambda functions. The downstream API has a rate limit of 1000 transactions/min. This rate is shared among…
8
votes
4 answers

Should i use Sleep() or just deny them

Im implementing a delay system so that any IP i deem abusive will automatically get an incremental delay via Sleep(). My question is, will this result in added CPU usage and thus kill my site anyways if the attacker just keeps opening new instances…
lasavior
  • 141
  • 1
  • 5
8
votes
3 answers

Should I rate-limit or reduce my database queries?

I'm creating a PHP script that imports some data from text files into a MySQL database. These text files are pretty large, an average file will have 10,000 lines in it each of which corresponds to a new item I want in my database. (I won't be…
nate
  • 83
  • 5
8
votes
1 answer

Limit number of requests sent per IP on Google App Engine Flex?

I am trying to add limit requests per IP on Google App Engine FLex NodeJs, I saw this rate-limiting-nginx documentation where Rate Limiting is applied on Nginx, but how can I use it inside my App Engine app. Also is there any default setting or any…
8
votes
1 answer

Ruby - Access Response Headers for Rate Limiting (Help Scout)

I'm using the helpscout ruby gem and trying to check when request limit is under a certain number (i.e 2 requests remaining) and sleep the loop for the remaining interval to allow for rate limit to be reset. Is there a way to access the response…
VegaStudios
  • 378
  • 1
  • 4
  • 22
8
votes
2 answers

Why Nginx rate limit is not rejecting exceeded requests?

This is my nginx configuration: { # on top of conf file limit_req_zone $binary_remote_addr zone=main:10m rate=1r/s; ... location /login { limit_req zone=main burst=3 nodelay; ModSecurityEnabled on; …
Anshul Bisht
  • 1,644
  • 20
  • 21
8
votes
2 answers

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

I have been writing a Google Chrome extension for Stack Exchange. 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…
8
votes
2 answers

Anyone knows Facebook chatbot sending limit?

If a merchant needs to send Facebook messages via mobile numbers (chatbot), what is the rate limit? This is a link on this topic but it does not talk about the actual…
8
votes
4 answers

OkHttp API rate limit

Has OkHttp an integrated way of complying with an api rate request limit, or it has to be implemented externally? either case a hint on where to start is appreciated.