lattebank / rate-limiter Goto Github PK
View Code? Open in Web Editor NEW基于redis限流系统
基于redis限流系统
rate-limiter还没有全面的使用手册,不方便使用
更高的 qps 会有什么问题呢
文章中提到的管理页面,在代码中没有?看到rate-limiter-server是没有管理页面的
限流lua中,contains()
方法判断apps时
第二个参数是表达式,所以apps名称不能出现正则中的特殊字符。。。
function string.find(s, pattern, init, plain) end
小坑,留意即可
目前所有代码都没有单元测试
修改前后ab测试,rate=3 测试10并发 100000请求,取不到token返回http403
Concurrency Level: 10
Time taken for tests: 109.817 seconds
Complete requests: 100000
Non-2xx responses: 99701
估计110*3=330 实际299
Time taken for tests: 112.894 seconds
Complete requests: 100000
Non-2xx responses: 99665
估计113*3=339 实际335 大致差距在每秒的数量基本正确
我有一个问题,就是本身在更新的时候是需要依赖锁的,guava的更新也是如此,否则在大并发的情况下会出现更新脏数据的情况,我看了下代码内部应该是没有做类似处理的?那机制是什么呢?通过lua?多机的时候怎么处理呢?
目前rate-limiter-server 还是使用简单的spring 模式
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.