问题原文
原帖链接 · Nicolas · CC BY-SA 4.0
In the Nginx configuration, when you want to limit the request processing rate by using the limit_req_zone / limit_req instructions, I don't really understand the use of the nodelay option.
In my understanding, it terminates the requests above the defined rate without delaying them. So it seems equivalent to burst=0.
That is why I don't understand the following example :
limit_req zone=one burst=5 nodelay;
burst defines the number of requests which could be delayed, so what is the meaning to define burst if there is the nodelay option?
已采纳解答
原帖链接 · Bernard Rosset · CC BY-SA 3.0
I find limit_req documentation clear enough.
burst is documented that way:
Excessive requests are delayed until their number exceeds the maximum burst size [...]
nodelay is documented that way:
If delaying of excessive requests while requests are being limited is not desired, the parameter nodelay should be used
Requests are limited to fit the defined rate. If requests are incoming at a higher rate, no more than the defined number of requests per time unit will be served. You then need to decide on what to do with those other requests.
- By default (no
burst, nonodelay), requests are denied with an HTTP 503 error. - With
burst, you stack the defined number of requests in a waiting queue, but you do not process them quicker than the defined requests per time unit rate. - With
burstandnodelay, the queue won't be waiting and request bursts will get processed immediately.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
