R
R
radiolip2014-11-06 17:31:58
PHP
radiolip, 2014-11-06 17:31:58

How to set up modules in Nginx, limit_zone, limit_req and limit_conn?

Good afternoon!
How to configure options in Nginx.conf, limit_zone, limit_req and limit_conn?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Benkovsky, 2014-11-06
@benbor

Well, in unix-like there is such a principle - it is silent, it means it works. Or specify what you want "Happened".
UDP:
let's read the documentation together: nginx.org/ru/docs/http/ngx_http_limit_req_module.html
1. You can connect the limit_req_log_level info log and see if nginx can tell you everything
2. >Syntax: limit_req zone=name [burst=number] [nodelay];
>Default: --
>Context: http, server, location
>Sets the shared memory zone (zone) and the maximum size of burst requests (burst). If >the rate of incoming requests exceeds that described in the zone, then their processing is delayed so that >requests are processed at the specified rate. Excess requests are delayed until >their number exceeds the maximum burst size. If exceeded, the request fails with an error >503 (Service Temporarily Unavailable). By default, the maximum splash size is zero. >For example, directives
>
>limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
>
>server {
> location /search/ {
> limit_req zone=one burst=5;
> }
> allow on average no more than 1 request per second with bursts of no more than 5 requests.
>
>If it is not necessary to delay excessive requests within the burst limit, then >use the nodelay parameter:
>
>limit_req zone=one burst=5 nodelay;
Where does the conclusion to play with burst come from, because by default it is 0 (usually 0 is infinitely many).
Set burst=1
3. Also to be seen. that you are using limit_req_zone, and she, like, only describes the zone, but does not use it. Try replacing it with limit_req
ps If it were necessary to include modules, nginx would swear that it does not know such directives, and if it is silent, then everything is fine. If this does not help - logs to the studio

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question