परिभाषा
Rate limiting एक traffic management control है जो enforce करता है कि कोई client एक specified time window के अंदर एक particular action कितनी बार perform कर सकता है। जब एक client threshold को exceed करता है, तो server एक error से respond करता है — आमतौर पर HTTP 429 Too Many Requests — या silently extra requests को drop करता है। Time window एक fixed schedule (एक “fixed window” counter) पर या एक rolling basis (एक “sliding window” counter) पर reset होता है, sliding windows window boundaries पर burst exploitation को prevent करने वाला smoother enforcement provide करते हैं।
Rate limiting सबसे पुराने और universally deployed web security controls में से एक है। OWASP (Open Web Application Security Project) इसे brute-force attacks, credential stuffing, और automated form abuse के विरुद्ध primary defense के रूप में recommend करता है। Cloudflare अपने WAF product के feature के रूप में rate limiting offer करता है, URL path, HTTP method, IP address, cookie value, और request header द्वारा configurable rules के साथ। AWS WAF, Azure Front Door, और Google Cloud Armor equivalent capabilities provide करते हैं।
Rate Limiting कैसे काम करता है
एक rate limiter प्रत्येक unique client identifier के लिए एक counter maintain करता है — सबसे commonly source IP address, लेकिन कभी-कभी एक account identifier, एक API key, या एक session cookie। जब एक request आती है, तो server उस identifier के लिए current counter value check करता है। यदि counter threshold से नीचे है, तो request allow होती है और counter increment होता है। यदि counter threshold पर या उसके ऊपर है, तो request 429 response के साथ rejected होती है या configured policy के अनुसार handled होती है।
Counter storage आमतौर पर Redis या Memcached में implemented होती है ताकि multiple server instances में fast, distributed lookups enable किए जा सकें — horizontally scaled applications के लिए एक requirement। Cloudflare documentation edge network level पर rate limiting enforcement describe करती है, जहां rules requests origin server तक पहुंचने से पहले apply किए जाते हैं, Cloudflare की global infrastructure में load reduction distribute करते हुए।
Contest context में common rate limiting parameters में शामिल हैं:
- Votes per IP per time window: सबसे common configuration। उदाहरण: प्रति IP address प्रति 24-hour window 1 vote से अधिक नहीं।
- Votes per account per contest: Authenticated user के account identifier को key के रूप में उपयोग करते हुए application layer पर enforced।
- Registrations per IP per hour: Bot-driven account farming को slow करने के लिए account-creation endpoint पर applied।
- API calls per token per minute: Public voting API expose करने वाले contest platforms के लिए relevant।
Rate limiting probabilistically भी apply की जा सकती है — उदाहरण के लिए, automation suggesting करने वाले behavioral या fingerprint signals के साथ आने वाली requests पर stricter limits applying करना, जबकि high-confidence human indicators वाले sessions पर looser limits applying करना।
आप इसे कहाँ देखते हैं
Rate limiting एक ubiquitous control है जो virtually हर web platform में present है। Contest operators इसे सबसे directly तीन points पर सामना करते हैं: vote-submission endpoint, account-registration form, और (यदि email confirmation required है) email-sending pipeline। API-driven contest integrations platform के API endpoints पर rate limits सामना करती हैं।
End users के लिए, rate limiting सबसे visibly एक HTTP 429 error या एक platform-specific message जैसे “आपने पहले ही vote कर दिया है” या “कृपया फिर से vote करने से पहले wait करें” के रूप में manifest होती है। कई platforms soft rate limiting implement करते हैं — request को accept करना लेकिन silently duplicate को discard करना — ताकि potential abusers को control के अस्तित्व का signal न दिया जाए।
Cloudflare की WAF rate limiting documentation note करती है कि rate limiting rules एक analysis phase के दौरान block किए बिना log पर set किए जा सकते हैं, फिर appropriate threshold calibrated होने पर blocking पर switched किए जा सकते हैं। यह two-phase approach contest operators को legitimate voting surges को accidentally block करने से बचने में मदद करता है।
व्यावहारिक उदाहरण
एक food blogger awards competition अपने voting system को 24-hour per-IP rate limit के साथ configure करती है। Contest के final week के दौरान, एक voter same residential IP address से rapid succession में 50 votes submit करने का प्रयास करता है। पहला vote accepted होता है; अगली 49 requests एक 429 response receive करती हैं। Voter का browser एक message display करता है जो once-per-day limitation को explain करता है।
एक SaaS contest platform जो सैकड़ों simultaneous contests host करता है, network edge पर Cloudflare की rate limiting का उपयोग करता है। एक bot एक contest को 10,000 requests per minute से target करता है edge पर 60 requests per minute के maximum तक throttle किया जाता है, extra requests कभी origin server तक नहीं पहुंचतीं। Origin server के logs केवल throttled traffic दिखाते हैं, और server-side CPU usage unaffected रहता है।
एक startup के custom contest microsite की एक OWASP security review email-confirmation resend endpoint पर rate limiting की absence को एक vulnerability के रूप में identify करती है — एक attacker हजारों confirmation emails trigger करके victim की inbox को flood कर सकता है। Review प्रति email address प्रति hour 3 resend requests की एक rate limit implement करने की recommend करती है, OWASP की brute-force prevention guidelines के अनुरूप।
संबंधित अवधारणाएँ
Anomaly detection rate limiting के लिए एक अधिक sophisticated complement है: जहां rate limiting hard thresholds enforce करता है, anomaly detection एक learned behavioral baseline से deviations identify करता है, fixed limits के नीचे रहने वाले fraud campaigns को catch करता है। ASN diversity तब relevant बनता है जब rate limits per-IP applied होते हैं और एक bad actor per-IP thresholds के नीचे रहने के लिए कई IP addresses में requests distribute करता है — ASN-level analysis aggregate pattern detect करता है। reCAPTCHA v3 एक behavioral risk score provide करता है जिसे potentially automated के रूप में score करने वाले sessions पर tighter limits selectively apply करने के लिए rate limiting के साथ combine किया जा सकता है।
सीमाएँ / चेतावनी
IP-based rate limiting carrier-grade NAT वाले environments में कम effective है, जहां एक single public IP सैकड़ों legitimate mobile subscribers को represent कर सकता है। प्रति 24 hours 1 vote की एक per-IP rate limit उन subscribers में से अधिकांश को voting से incorrectly prevent करेगी। यही कारण है कि contest platforms पर rate limiting को account-based या cookie-based deduplication के साथ layered होना चाहिए जब mobile audiences significant हैं। इसके अलावा, बहुत aggressively set किए गए rate limits university campuses, corporate offices, या large public Wi-Fi hotspots जैसे shared networks से आने वाले legitimate voters के लिए experience को degrade कर सकते हैं।