Pre-allocated Capacity Quota Limiting System Based on Microservice
In a distributed architecture,rate limiters that exist simultaneously on multiple nodes need to collaborate effectively to achieve the same effect as a monolithic rate limiter.In real-world business scenarios,there is irregular distribution of online re-quests and high offline business throughput.In such cases,certain critical nodes operating under overload conditions can result in slow response times,leading to increased overall latency in the request chain and even causing sluggish application performance.To address the issues of existing microservice flow limiting,this paper proposes a rate limiting algorithm based on proactive quota updates using pre-allocated quotas.This algorithm adopts a server-initiated broadcast approach where the server can both accept client requests and proactively update the latest results for processing requests on the nodes holding the resource quotas.Flexible allocation algorithms can be utilized during quota allocation at the server end.Estimation of rate limiter quotas involves sliding window pattern to track the number of requests and the allocated resource quotas over a period of time.Additionally,we imple-ment a rate limiting model based on this algorithm.Experimental results demonstrate that the model can promptly respond to quota changes and effectively achieve fairness among nodes.Compared to the Doorman system,the proposed model is better suited for online and offline traffic scenarios and enables more precise rate limiting.
Quota limitingMicroserviceToken bucketPush mechanismDistributed system