Open shokin opened 6 years ago
?
I think there is also a policy that the questions have to be in English on github. Please translate and either @agentzh or anyone else might be able to help.
@Willux at my point of view, the problem description is :
rate=5000r/s means 5r/ms, but in resty.limit.req, time granularity is also ms
level
two requests might arrive at the same time, which cause local elapsed = now - tonumber(rec.last) = 0
then excess = max(tonumber(rec.excess) - rate * abs(elapsed) / 1000 + 1000
calculation result always exceees burst=0
so the actual request processing rate might be closer to 1r/ms
not match 5r/s
thanks @NagamineLee @Willux for help
Hello @agentzh , here use your traffice function. If elapsed is 0 in the following statement, excess will return a number greater than 0 whether or not it exceeds concurrency, so burst stage will be carried out?
code:
log: req.lua:89: incoming(): 0:ms1536289344390-1536289344390,