v1.7.0
Added request per second rate limiting, see example rate limited config file for a full example. These are the new settings that go WITHIN the rate limiter definition:
maxReqPerSecond: 80
throttledReqPerSecondMinPauseMillis: 10
throttledReqPerSecondMaxPauseMillis: 50
overLimitReqPerSecondHttpErrorCode: 503
The throttledReqPerSecondMinPauseMillis
is a small pause that happens each time a request cannot be made, causing a hold on the thread for a short time to pull back the pressure.
The throttledReqPerSecondMaxPauseMillis
should be a value similar to this calculation: 1000 / maxReqPerSecond * 2.5
but should be a number less than 500. It is the amount of time that a thread will opportunistically wait for a guaranteed time slot to execute, if no time slot will be available it only waits the min pause and exits with error. The slots are known in advance, therefore no long pause happens when there is no chance of making it to a future slot.