Resource Tuner
|
Classes | |
class | RateLimiter |
RateLimiter. More... | |
To Prevent abuse of the system, Rate Limiting checks have been added.
This is implemented via the “RateLimiter” component.
Each client on initialization gets a pre-defined “health” of 100. We follow a Reward / Punish mechanism. Where a punishment implies a decrease in the\ health and a reward result in an increment in health (upto 100 max). If the client health drops to a value <= 0, then the client shall be dropped, i.e. any further requests sent by the client will be dropped without any further processing.
How are Punishment and Rewards Defined: RateLimiter provides a time interval “delta”, say 5 ms. If a client sends 2 requests within a time interval smaller than delta, then we punish the client. If consecutive client requests are suitably spaced out, we reward the client for good behavior.