सभी उदाहरण

उदाहरण

टोकन बकेट रेट लिमिटर, एक-एक रिक्वेस्ट करके

पांच रिक्वेस्ट की एक बौछार तीन टोकन वाली बकेट से टकराती है: तीन पार होती हैं, दो को 429 मिलता है, और बकेट फिर भर जाती है ताकि कुछ देर रुका क्लाइंट फिर से बौछार भेज सके।

यह वीडियो सिस्टम डिज़ाइन स्किल से बना है।

  • 1:05
  • सिस्टम डिज़ाइन
  • Iapetus की आवाज़ में
  • अंग्रेज़ी

प्रॉम्प्ट से बना

Design a rate limiter with a token bucket. Show a burst of requests and which ones get a 429.

वीडियो की ट्रांसक्रिप्ट

Five simultaneous requests can overwhelm your API unless you control the burst.

You start with a client calling your API directly, but sustained traffic pushes utilization to ninety-five percent.

We insert a token bucket limiter before the API, starting with three tokens and refilling one each second.

Each request spends one token, so five arriving together let three through and reject two with HTTP four twenty-nine.

Why reject instead of queueing? Immediate refusal bounds waiting, and clients should retry later with backoff.

The bucket refills continuously up to its capacity, so an idle client can burst again.

The cost is rejected work, and multiple API replicas must share an atomic bucket per client.

Use this at API entry points: the client sends, the limiter admits, and the API handles accepted work.

और उदाहरण

आपका टॉपिक, करीब एक मिनट में बनकर तैयार।

आपके पहले 2 वीडियो फ़्री हैं, हर वीडियो 1 मिनट तक का, वॉटरमार्क के साथ। कार्ड की ज़रूरत नहीं। पूरा प्रोडक्ट, हर आवाज़ और हर स्टाइल समेत।