问题原文
原帖链接 · Madhav Khakhar · CC BY-SA 3.0
While limiting the number of requests from an IP, I am using
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/m;
I can specify the rate in r/m (requests per minute) or r/s (requests per second). Is there a way to specify the rate in requests/hour ?
For example, I want the rate to be 75 requests/hour. So it will be 1.25r/m, but r/m has to be an integer. So, even that way it doesn't work.
Please help me out.
已采纳解答
原帖链接 · Tim · CC BY-SA 3.0
According to the documentation you can specify in requests per second or requests per minute, not requests per hour, so no it's not possible.
The rate is specified in requests per second (r/s). If a rate of
less than one request per second is desired, it is specified in
request per minute (r/m). For example, half-request per second
is 30r/m.
I suggest you round up or round down, according to your use case. 1r/s is 60 requests per minute, 2r/s is 120 requests per minute.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
