OctopusLian / leetcode-solutions

LeetCode,LintCode,牛客网,企业题库,《Sword to Offer》,《Cracking the Coding Interview》题解
MIT License
4 stars 4 forks source link

每日一题:使用redis实现分布式限流组件,要求高并发场景同一IP一分钟内只能访问100次,超过限制返回异常,写出实现思路或伪代码均可。 #193

Closed OctopusLian closed 2 years ago

OctopusLian commented 3 years ago

https://www.yuque.com/fudadajiagoushimeiriyiti/rqui93/sp53nr 固定窗口:string。key存ip,value存次数。 滑动窗口:list。key存ip,value=list,存每次访问的时间。