Download the PHP package frankerzeng/easy_ratelimiter without Composer
On this page you can find all versions of the php package frankerzeng/easy_ratelimiter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package easy_ratelimiter
php ratelimiter
基于内存的访问频率限制
作者在项目中用到的地方是登录注册风控,限制登录请求的次数,如10分钟内只能重试5次、短信验证码1分钟内最多发一次,24小时内最多发5次等
Setup/Installation
You can include this library by running:
composer require frankerzeng/easy_ratelimiter
Example
Debug
进入服务器控制共享内存
ipcs -m 查看本机共享内存的状态和统计
ipcrm -m shmid 清除共享内存中的数据。
Notice
-
需要开启shmop拓展
在Dockerfile中加入RUN docker-php-ext-install shmop
- 并发高的情况需要考虑原子性
TODO
由于共享内存的写操作不是原子性的,在并发大的情况下应该增加并发控制,保证原子性
All versions of easy_ratelimiter with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.5.0
The package frankerzeng/easy_ratelimiter contains the following files
Loading the files please wait ....