关于统计API调用次数,一直都没有比较通用的方案,那么今天我来给一个解决方案,从应用层解决,不需要开发人员去做(即使去做也不一定比这个好,别觉得哥狂妄).好了也不屁话这么多,开正题了.
0x1
ngx_dynamic_limit_req_module还是需要这个模块
cd redis-4.0**version**/deps/hiredis
make
make install
git clone https://github.com/limithit/ngx_dynamic_limit_req_module.git
cd ngx_dynamic_limit_req_module
git checkout limithit-API_alerts
./configure --add-module=/path/to/this/ngx_dynamic_limit_req_module
make
make install