-
Feature Request
-
Resolution: Done
-
Major
-
None
-
None
-
False
-
None
-
False
-
-
RATE_LIMITER is flawed because - if no credits are available - everybody sleeps until the end of the period and then they all send their data, possibly violating the rule that not more than max_bytes can be sent in the given period.
RATE_LIMITER works differently:
- There are max_bytes available
- A replenisher thread replenishes max_bytes every interval millis
- Senders decrement max_bytes by the number of bytes in the message and send until max_bytes is 0, then they block
- When the replenisher kicks in, senders are unblocked
- This ensures more or less that no more than max_bytes are sent in any given interval