Tagged articles
Leaky Bucket
53 articles · Page 1 of 1
This article deep-dives into Sentinel's core mechanisms including sliding window statistics, three rate-limiting algorithms, circuit breaker state machine, Slot chain execution flow, hotspot parameter limiting, rule persistence modes, Gateway/Feign integration, threshold calculation, and common pitfalls with troubleshooting steps.
Circuit BreakerFlow ControlLeaky Bucket
0 likes · 45 min read

This guide covers Nginx rate limiting via ngx_http_limit_req_module (leaky bucket algorithm), connection limiting with ngx_http_limit_conn_module, and bandwidth throttling using limit_rate, limit_rate_after, and proxy_limit_rate, including burst handling, nodelay, whitelists, and dynamic rate control via map variables.
Dynamic ConfigurationLeaky Bucketbandwidth-throttling
0 likes · 13 min read

This comprehensive guide covers Nginx rate limiting fundamentals, leaky bucket algorithm, configuration directives (limit_req_zone, limit_req, limit_conn_zone), practical scenarios (IP/URI-based limiting, whitelists, blacklists, CC attack defense), testing tools (wrk, ab, vegeta), monitoring with Prometheus, troubleshooting cases, and production rollout/rollback strategies.
CC AttackLeaky BucketOpenResty
0 likes · 42 min read

This article explains how to use Nginx's built‑in limit_req and limit_conn modules—based on the leaky‑bucket algorithm—to throttle requests by IP or API key, configure burst and nodelay behavior, apply whitelists, customize error responses, fine‑tune with delay and dry‑run modes, and monitor effectiveness in production environments.
API SecurityLeaky Bucketlimit_conn
0 likes · 22 min read

A bulk coupon‑sending job overwhelmed a million‑QPS system, revealing that message queues only buffer but do not shape traffic; the article dissects three failure points, compares leaky‑bucket and token‑bucket rate limiters, evaluates placement on producer, broker or consumer, and progresses from static limits to adaptive shaping with handling of throttled messages.
Leaky BucketMessage Queueadaptive throttling
0 likes · 18 min read

A bulk coupon‑sending job overwhelmed a 10 M‑QPS system, revealing that message queues only buffer traffic; the article walks through why rate‑limiting (leaky vs token bucket) must be added at the producer, broker, or consumer, evolves from static thresholds to adaptive shaping, and discusses how to handle throttled messages.
Leaky BucketMessage Queueadaptive throttling
0 likes · 18 min read

This article explains how to use Nginx's built‑in limit_req and limit_conn modules—based on the leaky‑bucket algorithm—to protect APIs from malicious flooding, excessive crawling, sudden traffic spikes, and individual user abuse, covering configuration directives, practical examples, advanced scenarios, testing, and deployment best practices.
API SecurityLeaky Bucketlimit_conn
0 likes · 20 min read

This guide explains how to use Nginx's built‑in limit_req and limit_conn modules to implement production‑grade rate limiting, covering leaky‑bucket theory, IP and API‑key based limits, burst and nodelay handling, whitelist bypass, custom error responses, dry‑run testing, memory sizing, and the inherent limitations that may require Redis‑Lua or OpenResty extensions.
API protectionLeaky Bucketanti‑crawler
0 likes · 21 min read

This guide explains how Nginx rate limiting works with the leaky‑bucket algorithm, provides step‑by‑step configuration examples for basic, burst, nodelay, and delay modes, and shows advanced techniques such as connection limiting, custom status codes, whitelisting, API‑key throttling, and a systematic deployment and tuning workflow.
BackendLeaky Bucket
0 likes · 8 min read

This article compares the token‑bucket and leaky‑bucket rate‑limiting algorithms, explaining their core principles, Java implementation details, key advantages and drawbacks, suitable application scenarios, interview‑style Q&A, and advanced hybrid strategies for building robust high‑concurrency systems.
JavaLeaky Bucketdistributed systems
0 likes · 9 min read

The article compares token bucket and leaky bucket rate‑limiting algorithms, explains their core principles, advantages, and suitable scenarios, and provides complete Java implementations with test code and interview tips for choosing the right approach.
AlgorithmInterviewLeaky Bucket
0 likes · 10 min read

This guide explains how to configure Nginx rate limiting using limit_req_zone and limit_req directives, covering syntax, parameters, burst handling, and a complete example that demonstrates setting a shared memory zone, request rate, burst buffer, and nodelay behavior for efficient traffic control.
Leaky Bucketlimit_reqlimit_req_zone
0 likes · 3 min read

This article explains Nginx rate‑limiting using the leaky‑bucket algorithm, demonstrates basic, burst, nodelay, and delay configurations with code examples, and discusses their effects on request handling while also including promotional material for related services.
Leaky Bucketburstnodelay
0 likes · 8 min read

This article walks through Nginx rate‑limiting configurations—starting with a basic leaky‑bucket setup, then adding burst and nodelay options—to illustrate how to control request flow, avoid excessive rejections, and manage latency in backend services.
Leaky Bucketburstnodelay
0 likes · 6 min read

This article explains the leaky bucket and token bucket algorithms, how they relate to traffic shaping, and provides practical Nginx configuration examples using the ngx_http_limit_req_module and ngx_http_limit_conn_module to control request rates and concurrent connections.
Leaky Bucketbackend developmentnginx
0 likes · 6 min read

An in‑depth guide explains three rate‑limiting algorithms—counter, leaky bucket, and token bucket—demonstrates their implementation in Spring Boot using Guava’s RateLimiter and Baidu’s ratelimiter‑spring‑boot‑starter, provides full Maven dependencies, configuration snippets, and Java code examples, and shows testing results.
GuavaLeaky BucketSpring Boot
0 likes · 8 min read

This article explains three core rate‑limiting algorithms—Leaky Bucket, Token Bucket, and Sliding Window—detailing their principles, suitable scenarios, and provides complete Go implementations to help developers choose and integrate the right strategy for handling traffic spikes and protecting backend resources.
AlgorithmBackendLeaky Bucket
0 likes · 15 min read

This article explains the fundamental concepts of rate limiting, including time and resource dimensions, various rule types such as QPS, connection count, bandwidth, black/white lists, and distributed considerations, then details common algorithms like token bucket, leaky bucket, sliding window, and practical implementations using Nginx, Guava, Redis, and Sentinel.
BackendLeaky Bucketdistributed systems
0 likes · 16 min read

This article explains the fundamental concepts of rate limiting, compares popular algorithms such as token bucket, leaky bucket, and sliding window, and reviews practical implementation methods including Nginx, middleware, Redis, Guava, and Tomcat configurations for both single‑machine and distributed environments.
Leaky Bucketrate limitingsliding window
0 likes · 17 min read

This article explains the basic concepts, dimensions, and typical algorithms of rate limiting, discusses various implementation strategies such as token bucket, leaky bucket, and sliding window, and reviews practical solutions using Nginx, Guava, Redis, Sentinel, and Tomcat for both single‑node and distributed environments.
Leaky Bucketsliding windowtoken-bucket
0 likes · 16 min read

This guide explains the fundamental dimensions of rate limiting, compares token‑bucket, leaky‑bucket, and sliding‑window algorithms, and details practical implementations using Guava, Nginx, Redis, and Sentinel for both single‑node and distributed systems.
GuavaLeaky BucketRedis
0 likes · 17 min read

This article explains the fundamentals of rate limiting, describes widely used algorithms such as token bucket, leaky bucket, and sliding window, and details practical implementation methods ranging from single‑machine tools like Guava and Tomcat to distributed solutions using Nginx, Redis, and Sentinel.
Leaky Bucketdistributed systemsrate limiting
0 likes · 17 min read

Rate limiting safeguards distributed systems by controlling request rates through algorithms such as leaky bucket, token bucket, fixed and sliding windows, and back pressure, while client‑side tactics like exponential backoff, jitter, and careful retries, and requires atomic distributed storage solutions (e.g., Redis+Lua) to avoid race conditions.
AlgorithmLeaky Bucketback pressure
0 likes · 16 min read

This article explains the principle of interface idempotency, presents practical techniques such as version‑based updates and token mechanisms, and then delves into distributed rate‑limiting dimensions, common algorithms like token‑bucket and leaky‑bucket, and concrete implementations using Guava, Nginx, Redis and Lua with full code examples.
Distributed Rate LimitingIdempotencyLeaky Bucket
0 likes · 21 min read

This article explains what rate limiting is, why it is needed, various strategies and algorithms such as leaky bucket, token bucket, fixed and sliding windows, and discusses challenges like inconsistency and race conditions in distributed systems, as well as different throttling types.
APIBackendLeaky Bucket
0 likes · 10 min read

This guide explains the principles of API idempotency using unique business IDs or token mechanisms, explores distributed rate‑limiting dimensions, compares token‑bucket and leaky‑bucket algorithms, and provides concrete implementations with Guava RateLimiter, Nginx configuration, and a Redis‑Lua script integrated into Spring Boot, including annotation‑based AOP for easy usage.
API idempotencyDistributed Rate LimitingGuava RateLimiter
0 likes · 19 min read

This article explains the importance of interface idempotency and presents a comprehensive guide to distributed rate limiting, covering key dimensions, token‑bucket and leaky‑bucket algorithms, and concrete implementations using Guava RateLimiter, Nginx, and Redis‑Lua with Java code examples.
IdempotencyLeaky Bucketrate limiting
0 likes · 19 min read

This article explores three core rate‑limiting algorithms—Leaky Bucket, Token Bucket, and Sliding Window—detailing their principles, suitable scenarios, and provides complete Go implementations, enabling developers to choose and integrate the appropriate strategy for controlling request traffic without external dependencies.
BackendLeaky Bucketrate limiting
0 likes · 15 min read

This article explains how to achieve interface idempotency using unique business IDs or token mechanisms and presents comprehensive distributed rate‑limiting techniques—including token‑bucket and leaky‑bucket algorithms, Nginx directives, Guava RateLimiter, and Redis‑Lua scripts—along with practical Spring Boot code examples.
IdempotencyLeaky BucketLua
0 likes · 16 min read

This article explains the concept of interface idempotency, presents practical techniques such as version‑based updates and token mechanisms, and then dives into distributed rate‑limiting strategies covering dimensions, token‑bucket and leaky‑bucket algorithms, and concrete implementations using Guava RateLimiter, Nginx, and Redis‑Lua scripts.
Leaky BucketLuatoken-bucket
0 likes · 18 min read

This article explains four common rate‑limiting algorithms—fixed‑window counter, sliding window, leaky bucket, and token bucket—detailing their mechanisms, advantages, drawbacks such as the critical‑window problem, and how they can be implemented simply using Redis in backend systems.
BackendLeaky Bucketcounter algorithm
0 likes · 4 min read

This article explains how Nginx rate limiting works, covering the leaky‑bucket algorithm, basic and advanced configurations such as burst and nodelay parameters, whitelist handling, multiple limits, logging, custom status codes, and how to deny all requests for a location.
ConfigurationLeaky Bucketburst
0 likes · 13 min read

This article explains how Nginx implements rate limiting using the leaky‑bucket algorithm, walks through basic and advanced configurations—including zones, burst, nodelay, whitelists, multiple limits, logging, custom status codes, and request denial—while providing complete configuration examples.
Leaky BucketSecuritybackend configuration
0 likes · 13 min read

This article explains the purpose, scenarios, and detailed implementations of common rate‑limiting algorithms—including counter (fixed window), sliding window, token bucket, and leaky bucket—highlighting their advantages, drawbacks, and sample Python code for each.
BackendLeaky Bucketcounter algorithm
0 likes · 12 min read

This guide explains Nginx's rate‑limiting feature, covering its leaky‑bucket algorithm, basic and advanced configurations—including limit_req_zone, limit_req, burst, nodelay, whitelisting, logging, and custom error codes—to help you protect upstream servers and mitigate abuse.
BackendLeaky Bucketlimit_req
0 likes · 14 min read

The article introduces the concept of rate limiting, explains why it is needed both offline (e.g., crowded theme parks) and online (e.g., flash sales), and details four common algorithms—counter, sliding window, leaky bucket, and token bucket—along with their implementation considerations and trade‑offs.
Leaky Bucketcounter algorithmrate limiting
0 likes · 9 min read

This article explains three classic rate‑limiting algorithms—counter, leaky bucket, and token bucket—illustrates their principles, compares their behavior, and provides practical Spring Boot implementations using Google Guava’s RateLimiter and Baidu’s ratelimiter‑spring‑boot‑starter, including configuration, code samples, and performance testing.
BackendGuavaJava
0 likes · 10 min read

This article introduces rate limiting, explains its purpose and classifications, compares fixed and sliding windows, describes common algorithms such as token bucket, leaky bucket, and counter, and provides detailed Go code examples using the golang.org/x/time/rate library for practical implementation.
Leaky Bucketgolangrate limiting
0 likes · 25 min read

This article explains the principles of leaky‑bucket and token‑bucket rate‑limiting algorithms, compares their behavior in high‑concurrency e‑commerce scenarios, and provides a complete Python implementation to illustrate how token‑bucket can handle burst traffic while maintaining system stability.
Leaky BucketPythonhigh concurrency
0 likes · 7 min read

This article explains the role of caching, service degradation, and flow control in high‑concurrency systems, introduces common rate‑limiting algorithms such as counters, leaky bucket and token bucket, and provides practical Java and Nginx implementations with code examples.
CachingLeaky Bucketdegradation
0 likes · 14 min read

This guide explains how Nginx implements rate limiting using the leaky‑bucket algorithm, walks through basic and advanced configurations—including limit_req_zone, limit_req, burst, nodelay, whitelisting, multiple limits, logging, and custom status codes—while providing concrete code examples and practical tips.
ConfigurationLeaky Bucketlimit_req
0 likes · 14 min read

This article explains the principles of rate limiting, compares the leaky bucket and token bucket algorithms, and demonstrates how Guava's RateLimiter (including SmoothBursty and SmoothWarmingUp implementations) works in Java with detailed code examples and execution flow.
GuavaJavaLeaky Bucket
0 likes · 10 min read

This article explains the fundamentals of rate limiting for high‑concurrency systems, covering why it is needed, the conditions that trigger it, and detailed introductions to the three main algorithms—counter (fixed and sliding windows), leaky bucket, and token bucket—along with their advantages, drawbacks, and sample pseudo‑code implementations.
BackendLeaky Bucketcounter algorithm
0 likes · 13 min read

This article explains the principles of token‑bucket and leaky‑bucket rate‑limiting algorithms, shows how Nginx implements them with the limit_req and limit_conn modules, and provides detailed configuration examples—including burst, nodelay, and custom status codes—to control request rates and concurrent connections.
Leaky Bucketlimit_connlimit_req
0 likes · 12 min read

The article explains the principles of traffic shaping through leaky‑bucket and token‑bucket algorithms, details how Google Guava's RateLimiter implements token‑bucket rate limiting, and provides Java code examples illustrating token generation, acquisition, and practical usage in high‑concurrency backend systems.
BackendGuavaJava
0 likes · 10 min read

This article explains the three essential tools for building high‑concurrency systems—caching, service degradation, and rate limiting—detailing their purposes, common algorithms such as counter, leaky bucket and token bucket, and providing concrete Java and Nginx configuration examples.
GuavaLeaky Bucketrate limiting
0 likes · 14 min read

This comprehensive guide explains the differences between rate limiting and circuit breaking, outlines how to determine system capacity, details four core throttling strategies (fixed window, sliding window, leaky bucket, token bucket), and offers practical best‑practice recommendations for distributed backend systems.
BackendLeaky Bucketrate limiting
0 likes · 14 min read

This article explains why rate limiting is essential for flash‑sale (seckill) systems, compares token‑bucket and leaky‑bucket algorithms, and provides concrete Tomcat, Nginx, OpenResty, and Guava configurations along with code snippets and load‑testing results to help engineers implement robust throttling.
Leaky BucketOpenRestyTomcat
0 likes · 14 min read


21CTOJun 16, 2018 · Backend Development
This article explains why high‑traffic scenarios like flash‑sale systems need rate limiting, compares token‑bucket and leaky‑bucket algorithms, and shows practical configurations for Tomcat, Nginx, and OpenResty to protect APIs and ensure system stability.
Leaky BucketOpenRestyTomcat
0 likes · 10 min read

During high‑traffic scenarios, services can become unavailable, so implementing rate‑limiting techniques like token bucket, leaky bucket, and counter algorithms—illustrated with Java code examples using Guava RateLimiter, AtomicInteger, and Semaphore—helps smooth bursts, control concurrency, and prevent system overload.
GuavaLeaky Bucketcounter algorithm
0 likes · 6 min read

This article provides a comprehensive guide to rate limiting in high‑concurrency systems, covering core concepts, token‑bucket and leaky‑bucket algorithms, application‑level techniques with Guava, distributed implementations using Redis+Lua and Nginx+Lua, and edge‑layer controls via Nginx modules, complete with configuration examples and test results.
GuavaLeaky Bucketdistributed systems
0 likes · 28 min read

This article explains how caching, degradation, and especially rate limiting—using token bucket, leaky bucket, and counter‑based methods—protect high‑concurrency systems, covering algorithm basics, application‑level techniques, and distributed implementations with Redis+Lua and Nginx+Lua.
Leaky Bucketdistributed systemsrate limiting
0 likes · 18 min read


21CTOJun 12, 2016 · Backend Development
This article explains why caching, degradation, and rate limiting are essential for high‑concurrency systems, details token‑bucket and leaky‑bucket algorithms, shows application‑level, distributed, and edge‑level throttling techniques, and provides practical Java, Guava, Redis‑Lua, and Nginx‑Lua code examples.
GuavaJavaLeaky Bucket
0 likes · 17 min read
