रिसोर्स · 77
API कोटा और दर सीमाएँ
सीमाएँ क्षमता, पुनः प्रयास और ग्राहकों के बँटवारे को प्रभावित करती हैं।
अपडेटेड · 12 min
यह गाइड क्या पाने में मदद करती है
- बजट स्पष्ट करें
- पुनर्प्राप्ति सीमित करें
- अनिश्चित कार्य सुलझाएँ
- पुनः प्रयास की जिम्मेदारी दें
- बेकार हो चुका काम रोकें
जल्दी से चेक करें
- कोटा दायरा, हेडर, प्रतीक्षा और प्रयास बजट दर्ज करें; नियंत्रित समाप्ति जाँचें।
- एक साथ पुनः प्रयास अधिक भार बढ़ा सकते हैं।
स्टेप-बाय-स्टेप तरीका
- 1
बजट स्पष्ट करें
दर्ज करें कि कोटा खाते, कुंजी या संसाधन पर लागू है और क्लाइंट कितने समानांतर कार्य स्वीकार करता है। औसत दर कम होने पर भी असीमित कतार सेवा पर अधिक भार डाल सकती है।
कोटा इकाई, समवर्ती कार्य और कतार आकार दर्ज करें।
- 2
पुनर्प्राप्ति सीमित करें
429 में Retry-After हो तो उसे समझें और अगली माँग से पहले प्रतीक्षा करें। बढ़ती प्रतीक्षा और क्लाइंट के बीच समय वितरण को अधिकतम प्रयास और कुल समय सीमा से जोड़ें।
प्रयासों का क्रम और समय रखें।
- 3
अनिश्चित कार्य सुलझाएँ
लेखन का उत्तर खो जाए तो दोहराने से पहले स्थिति जाँचें। अनुकरण में कोटा, देर से उत्तर और रद्द करना मिलाएँ; कतार बिना दोहराए प्रभाव के समाप्त होनी चाहिए।
अंतिम प्रभाव और लंबित कार्य रखें।
- 4
पुनः प्रयास की जिम्मेदारी दें
ऐप, SDK, प्रॉक्सी और निर्भरता के स्वतः प्रयास लिखें। जिम्मेदार परत चुनें और अनुबंध अनुसार अतिरिक्त प्रयास बंद या समन्वित करें। पहला प्रयास कुल बजट में गिनें। कार्य ID बचाएँ और गैर-इडेम्पोटेंट पुनः प्रयास से पहले अनिश्चित असर जाँचें।
प्रयास मानचित्र और प्रति कार्य कुल बजट।
- 5
बेकार हो चुका काम रोकें
क्लाइंट की असली सीमा अनुसार प्रतीक्षा, कनेक्शन और प्रक्रिया सहित कुल अंतिम समय तय करें। कतार में प्रवेश से पहले समाप्त कार्य अस्वीकार करें। स्थानीय रद्द करना सर्वर रोकना साबित नहीं करता; स्थिति मिलाएँ। सारी कतारें एक साथ चालू किए बिना धीरे वापसी जाँचें।
साझा समय सीमा और रोक या मिलान प्रमाण।
दोहराने योग्य स्वीकृति मामला
काल्पनिक उदाहरण: डेटा किसी ग्राहक या देखे गए परिणाम का नहीं है।
मामले के इनपुट देखें
{
"http_status": 429,
"retry_after_seconds": 30,
"workers": 20,
"retry_budget": 3,
"retry_budget_scope": "per_worker_retries_excluding_initial_request",
"scheduling_example": {
"response_received_at_seconds": 0,
"illustrative_retry_seconds": [
30,
31,
32,
33,
34
],
"workers_per_second": 4,
"alternative_deadline_seconds": 25,
"total_attempts_if_all_retries_used": 80
}
}अपेक्षित निर्णय
30 सेकंड प्रतीक्षा करें, 20 वर्करों के प्रयास अलग समय पर करें और पुनः प्रयास सीमित रखें।
बीस क्लाइंट: पुनः प्रयास बाँटें और गिनें
काल्पनिक उदाहरण: 20 वर्कर +0 s पर अलग-अलग 429 उत्तर और Retry-After: 30 प्राप्त करते हैं। समय-सारणी एक संभावित वितरण है, सर्वर क्षमता की गारंटी नहीं। हर वर्कर के पास शुरुआती अनुरोध के अलावा 3 पुनः प्रयास हैं।
| नीति | गणना या समय-सारणी | प्रभाव और सीमा |
|---|---|---|
| एक साथ पुनः प्रयास | 20 × 1 = 20 @ +30 s | 30 सेकंड प्रतीक्षा करने से समय का निर्देश पूरा होता है, लेकिन सभी 20 अनुरोध साथ लौटते हैं और भार फिर बढ़ सकता है। |
| फैले हुए पुनः प्रयास | 4 × 5 = 20 @ +30…+34 s | पाँच सेकंड तक प्रति सेकंड चार अनुरोध भेजने से 20 पुनः प्रयास फैलते हैं, उनकी संख्या घटती नहीं। यह उदाहरण क्रमिक प्रतीक्षा और यादृच्छिक अंतर वाली नीति का विकल्प नहीं है। |
| 25 सेकंड की समय-सीमा | 25 s < 30 s → 0 | यदि बचा समय आवश्यक 30 सेकंड से कम है, तो अनुबंध के अनुसार रोकें या स्थगित करें। समय-सीमा के लिए प्रतीक्षा कम न करें। |
| अधिकतम बजट | 20 × (1 + 3) = 80 | सभी प्रयास इस्तेमाल करने पर 20 शुरुआती अनुरोध और 60 पुनः प्रयास, कुल 80 अनुरोध होते हैं। सीमा सफलता या सुरक्षित दोहराव की गारंटी नहीं है। |
जाँचने के लिए काल्पनिक रूपांतर
Retry-After में सेकंड नहीं, HTTP तारीख होती है।
दस्तावेज़ वाला प्रारूप समझें और घड़ी जाँचें। निकाली गई प्रतीक्षा दर्ज करें; तारीख की जगह मनमाना विलंब न लगाएँ।
हर वर्कर का अपना पुनः प्रयास बजट है।
कुल भार भी गिनें। साझा कोटा समन्वित करें और प्रयास फैलाएँ, ताकि एक और समकालिक उछाल न आए।
व्यावसायिक प्रभाव वाले ऑपरेशन के बाद उत्तर नहीं मिला।
दोहराने से पहले संदर्भ स्रोत की स्थिति और इडेम्पोटेंसी अनुबंध जाँचें। समय समाप्त होना निष्पादन न होने का प्रमाण नहीं है।
सुरक्षित रखने योग्य साक्ष्य
- प्राप्त हेडर, प्रतीक्षा प्रारूप और इस्तेमाल की गई घड़ी।
- कुल प्रयास बजट और अधिकतम अवधि।
- ऑपरेशन पहचानकर्ता और मिलान किया परिणाम।
अतिरिक्त संदर्भ : IETF — RFC 9110, Retry-After [EN]
सत्यापन प्रक्रिया
- कोटा दायरा और पुनः प्रयास बजट दर्ज करें।
- केवल अधिकृत परीक्षण में कोटा खत्म करें।
- 429, Retry-After और सीमित समयक्रम रखें। तकनीकी सीमा और व्यावसायिक परिणाम में अंतर करें; समाप्त कोटे को शून्य स्टॉक बताने वाले उत्तर में न बदलें।
- बाहरी भार बिना चार परतों के तीन कुल कॉल का अनुकरण कर प्रयास गिनें।
- काल्पनिक कतार कार्य समाप्त करें और नया कार्य न शुरू होने की पुष्टि करें।
- काल्पनिक विफलता बाद अधिकृत काम धीरे लौटाएँ और कॉल, सीमा तथा विशिष्ट परिणाम बचाएँ।
API: परतों में गुणा होते पुनः प्रयास रोकें
ऐप, SDK, प्रॉक्सी और सेवा एक कॉल फिर कर सकते हैं। चार काल्पनिक परतों में हर एक के तीन कुल प्रयास अंतिम विफल निर्भरता पर अधिकतम81 कॉल देते हैं। कोटा नियंत्रण में साझा बजट और उपयोगी समय सीमा जोड़ें।
काल्पनिक काम का उदाहरण
उदाहरण वाली स्थिति
कोटा दायरा, हेडर, प्रतीक्षा और प्रयास बजट दर्ज करें; नियंत्रित समाप्ति जाँचें।
फैसला और उम्मीद का सबूत
नहीं। खोए उत्तर वाले कार्य का अलग मिलान आवश्यक है; दूसरी कोशिश के उत्तर से उसकी स्थिति न निकालें।
मैनेजमेंट इंडिकेटर
| इंडिकेटर | यह क्या मापता है | पहला एक्शन |
|---|---|---|
| प्रति कार्य प्रयास | एक ही तार्किक कार्य के लिए भेजे प्रयास | बजट समायोजित करें और चक्र रोकें |
| कतार की आयु | कार्य स्वीकार होने से प्रतीक्षा समय | समय सीमा से बाहर कार्य रद्द या आगे भेजें |
| कॉल बढ़ोतरी | निर्भरता कॉल / उसी अवधि के प्रारंभिक कार्य | कुल प्रयास, पुनः प्रयास और नियत उपकॉल अलग रखें |
| स्वीकृत समाप्त काम | उपयोगी समय बाद शुरू कार्य | कतार, रद्द करना और शुरू असर भी देखें |
आम गलतियाँ
- एक साथ पुनः प्रयास अधिक भार बढ़ा सकते हैं।
अक्सर पूछे जाने वाले सवाल
क्या 429 साबित करता है कि पिछला लेखन नहीं हुआ?
नहीं। खोए उत्तर वाले कार्य का अलग मिलान आवश्यक है; दूसरी कोशिश के उत्तर से उसकी स्थिति न निकालें।
हर परत पर तीन प्रयास क्या कुल तीन हैं?
नहीं। चार काल्पनिक परतों पर तीन कुल प्रयास से अंतिम निर्भरता पर अधिकतम3⁴ = 81 कॉल होते हैं।
समाप्त कार्य दूर का असर रद्द करता है?
जरूरी नहीं। नया बेकार काम रोके; शुरू दूर कार्य की स्थिति और संभव क्षतिपूर्ति जाँचें।
Retry-After: प्रतीक्षा, बजट और पुनःप्रयास
इस संस्करण में विस्तृत संदर्भ टिप्पणियाँ अंग्रेज़ी में उपलब्ध हैं।
Decide whether to retry after 429 or 503
A waiting period answers “when?”, not “may this operation be repeated?”. Before retrying, identify the intended effect, read the provider contract and bound total work. An error status or a lost response does not prove that no earlier attempt produced an effect.
Local teaching model with no request, timer, storage or real write. It considers one decision after 429 or 503 using six predefined headers. Dates are read at the fictional instant 22 October 2026, 10:00:00 UTC, assuming an accurate clock. This is neither a complete HTTP parser nor a Stripe client. Obsolete HTTP-date forms, clock skew, transport and SDK-specific policies are outside the calculation.
Twelve ways to read Retry-After
Durations are seconds. Absolute dates need an explicit clock policy; calculations here assume the stated accurate clock. Past dates become zero in this model without permitting an immediate loop. Integer syntax alone does not define a client’s numeric limits.
| Illustrative value | Reading within this scope | Interpretation decision |
|---|---|---|
30 | Non-negative decimal integer: wait 30 seconds after receipt. | This means seconds, not 30 milliseconds. |
0005 | The 1*DIGIT syntax accepts these digits: 5 seconds. | Do not treat the leading zero as octal. |
0 | A declared delay of zero seconds. | Local policy, budgets and permission to repeat still require checking. |
Thu, 22 Oct 2026 10:00:45 GMT | An HTTP date 45 seconds after the fictional receipt time. | Clock uncertainty must not be silently treated as certainty. |
Thu, 22 Oct 2026 09:59:50 GMT | A date 10 seconds in the past; the model uses zero server wait. | A past date requires neither negative waiting nor unlimited replay. |
Field absent | No server wait is supplied. | This model uses its selected local delay, not a normative default. |
1.5 | 1.5 does not meet integer delay-seconds syntax. | Do not silently round it and call the field valid. |
-1 | -1 is not a non-negative decimal integer for this field. | Do not interpret it as a special permission. |
30s | The s unit suffix is not part of delay-seconds syntax. | Seconds are already implied; 30s is not the form 30. |
30, 60 | Two comma-separated durations are not one valid Retry-After value. | Do not split every comma: a valid HTTP date itself contains one. |
Empty value | The field exists but contains neither expected form. | Keep absent and malformed values distinct in records. |
9999999999999999999999 | The digit string meets integer syntax but exceeds this model’s numeric bounds. | Record the local limit without claiming the RFC sets it; never truncate to retry sooner. |
Compare waiting, remaining budget and duplicate risk
Five parameters cover 144 combinations. Fictional policy: wait for the greater of an interpretable server delay and the already selected local delay, then reserve 10 seconds for one attempt. If the remaining budget is insufficient, stop this interactive retry without shortening the server wait. The reserve is not a measured duration and the selected local delay is not a jitter generator.
Teaching decision :
The selected operation type and budget allow considering a retry in this model. This proves neither success nor authorisation on a real service.
- Interpretable server wait
- 30 s
- Selected wait
- 30 s
- Attempt reserve
- 10 s
- Wait + reserve
- 40 s
- Budget margin
- 20 s
Absent or invalid field: this wait comes from local policy. A real API can require a different decision.
Eight reproducible cases
| Fictional situation | Relevant parameters | Decision and limit |
|---|---|---|
| 429, read and 30-second wait | 429 · 30 seconds Conforming GET read Remaining budget after receipt : 60 s | Retry candidate With 60 seconds remaining, 30 + 10 leaves a 20-second margin. |
| Waiting exceeds the budget | 429 · 30 seconds Conforming GET read Remaining budget after receipt : 20 s | Stop this retry With 20 seconds remaining, do not shorten 30 just to force an attempt. |
| Write with unknown contract | 503 · Future date: +45 seconds POST write: retry contract unverified Remaining budget after receipt : 60 s | Check business state Even positive margin does not validate repeating POST. |
| Write with verified contract | 503 · Future date: +45 seconds POST write: retry contract verified Remaining budget after receipt : 60 s | Retry candidate Verified contract is an assumption, not a test of your provider. |
| Invalid fractional value | 503 · Invalid value: 1.5 Conforming GET read Remaining budget after receipt : 20 s | Retry candidate The five-second fallback is a local teaching choice; retain the parse error. |
| Absent field, long local delay | 429 · Field absent Conforming GET read Remaining budget after receipt : 60 s | Retry candidate The 40-second delay comes from the client rather than the server. |
| HTTP date already passed | 503 · Past date: −10 seconds Conforming GET read Remaining budget after receipt : 20 s | Retry candidate The model retains a five-second local delay; the past date triggers no immediate call. |
| Zero does not remove the budget | 429 · 0 seconds Conforming GET read Remaining budget after receipt : 20 s | Stop this retry The 40-second local delay plus reserve exceed the 20 seconds remaining. |
Five distinctions that change client behaviour
| Reference point | Documented meaning | Practical limit |
|---|---|---|
| 429 | RFC 6585 describes too many requests within a period. Retry-After may be present; a 429 response must not be stored by a cache. | The RFC does not set the provider’s counted identity, window or algorithm. |
| 503 | Retry-After can indicate the expected duration of service unavailability. | A 5xx alone does not establish whether a write can be replayed. |
| HTTP idempotence | PUT, DELETE and safe methods are idempotent in their intended effect. | Responses and logs may differ. Controlled POST retries need an additional contract. |
| Retries at multiple layers | Client, SDK and proxy attempts can multiply load. | In a fictional three-layer example with three total attempts at each layer, one request can generate up to 3 × 3 × 3 = 27 calls at the last layer. |
| Jitter and budget | AWS describes spreading retries to avoid synchronised clients. | Randomness makes no write idempotent and replaces neither a deadline nor an attempt limit. |
Five items for retry acceptance evidence
- Method, route, contract version and logical operation identity; keep secrets out of keys and logs.
- Status, raw field, receipt time, interpretation and clock assumption.
- Selected delay, current attempt, remaining budget and the layer actually controlling retries.
- Known or unknown business state, retry key, associated context and parameters, and reconciliation evidence when needed.
- Verified final outcome and user behaviour: understandable waiting, retained input and no button that unintentionally recreates an operation.
Compare idempotency contracts →
Primary sources and limits
The RFCs define the cited HTTP elements. AWS describes design choices and Stripe documents its own APIs. Budgets, local waits, cases and diagrams are educational: they neither measure your service nor execute requests.
- IETF · RFC 9110 — Retry-After et idempotence HTTP · June 2022 · STD 97
§5.6.7; §9.2.2; §10.2.3; §15.6.4 - IETF · RFC 6585 — 429 Too Many Requests · April 2012 · Standards Track
§4 - AWS Builders’ Library · Timeouts, retries, and backoff with jitter · Published 2019-12-05; accessed 2026-10-22
Retries; jitter; timeout scope - Stripe · Idempotent requests · Documentation accessed 2026-10-22
API v1: saved results, parameters, key pruning, execution boundary - Stripe · API v2 overview — Idempotency · Documentation accessed 2026-10-22
POST/DELETE; same API and account/sandbox; 30-day replay window - Stripe · Advanced error handling · Documentation accessed 2026-10-22
Stripe-Should-Retry; status codes; idempotency
References reviewed
GraphQL: त्रुटियाँ, सूचियाँ और आंशिक डेटा
इस संस्करण में विस्तृत संदर्भ टिप्पणियाँ अंग्रेज़ी में उपलब्ध हैं।
GraphQL cost and partial results: two separate checks
An authorized query can still be too costly; a partial response measures none of its resource consumption.
- Compare absent data, partial data and data: null.
- Keep the original path even when a parent becomes null.
- Test permissions, quotas and interface states separately.
Explore GraphQL responses and nullability →
GraphQL Specification · September 2025 · Published edition · September 2025
ऑफ़िशियल रेफ़रेंस
रेफ़रेंस इस तरीके को सपोर्ट करते हैं। अपने कॉन्टेक्स्ट के हिसाब से चेक को एडजस्ट करें; वे सर्टिफ़िकेशन नहीं हैं। ओरिजिनल रेफ़रेंस टाइटल और सोर्स डॉक्यूमेंट दूसरी भाषा में हो सकते हैं।
संदर्भ जाँच की तारीख .
- IETF — RFC 6585, HTTP 429
- IETF — RFC 9110, Retry-After
- AWS — Timeouts, retries, and backoff with jitter
- IETF — RFC 9110, Retry-After
- GraphQL Specification · September 2025
- IETF · RFC 9110 — Retry-After et idempotence HTTP
- IETF · RFC 6585 — 429 Too Many Requests
- Stripe · Idempotent requests
- Stripe · API v2 overview — Idempotency
- Stripe · Advanced error handling
