Skip to content

A real redis-based RateLimiter to control QPS smooth.

License

Notifications You must be signed in to change notification settings

z-meng/redis-rate-limiter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RedLimiter

RedLimiter(Redis rate limiter),与Guava RateLimiter功能类似,基于Redis+Lua+令牌桶算法实现的分布式限流器,提供

  • 限流
  • 流量整形
  • 批处理避免Redis热点

原理

  • 令牌桶算法
  • 通过延迟计算方式向令牌桶里加入令牌
  • 通过Lua脚本和Redis单线程的特性保证操作的原子性

Lua脚本里提供了整个获取令牌过程。

About

A real redis-based RateLimiter to control QPS smooth.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 84.3%
  • Lua 15.7%