openresty / lua-resty-limit-traffic

Lua library for limiting and controlling traffic in OpenResty/ngx_lua
816 stars 149 forks source link

resty.limit.req vs resty.limit.count #39

Open chopper-poet opened 6 years ago

chopper-poet commented 6 years ago

what is different resty.limit.req with resty.limit.count? If i want to restrict qps,which one shoud i choose?

thks.

Xuhaomiao commented 5 years ago

you should choose resty.limit.req, it based on the leaky bucket algorithm. resty.limit.count is similar to quota or frequency control, it based on the fixed window algorithm. resty.limit.req is more accurate than resty.limit.count for qps control.

chopper-poet commented 5 years ago

thks

you should choose resty.limit.req, it based on the leaky bucket algorithm. resty.limit.count is similar to quota or frequency control, it based on the fixed window algorithm. resty.limit.req is more accurate than resty.limit.count for qps control.