रेट लिमिटिंग क्लायंटला एका वेळ विंडोमध्ये किती विनंत्या करता येतात हे प्रतिबंधित करते — सिस्टमला गैरवापरातून, ओव्हरलोडपासून संरक्षण देते आणि न्याय्य वापरण्याची खात्री देते. हा एक सामान्य सिस्टम-डिজाइन घटक आहे, ज्यामध्ये अनेक अल्गोरिदम आणि विचारणीय गोष्टी आहेत.
रेट लिमिटिंग का महत्त्वाचे आहे
✓ PROTECT against abuse → prevent attacks (brute force, scraping, DoS), excessive use
✓ PREVENT OVERLOAD → protect the system from being overwhelmed (stability)
✓ FAIR USAGE → ensure no single client monopolizes resources; tiered limits (free vs paid)
✓ COST control; protect downstream services
→ a common requirement for APIs and services.
रेट लिमिटिंग अल्गोरिदम
FIXED WINDOW → count requests per fixed time window (e.g. 100/minute); simple
✗ allows bursts at window boundaries (up to 2x at the edges)
SLIDING WINDOW → rolling time window → smoother, no boundary bursts (more accurate)
TOKEN BUCKET → tokens refill at a rate; each request takes a token → allows BURSTS up to
the bucket size while limiting the average rate (popular, flexible)
LEAKY BUCKET → requests processed at a steady rate (smooths output)
