Home  >  Article  >  Backend Development  >  nginx current limiting algorithm

nginx current limiting algorithm

WBOY
WBOYOriginal
2016-07-28 08:29:161670browse

nginx current limiting mainly includes the limit_conn module and the limit_req module

limit_conn limits the number of connections, and limit_req limits the request rate

limit_conn limits the current

http {

limit_conn_zone $binary_remote_addr z/p>

limit_conn_log_level error;

limit_conn_status 503;

server {

...

location /{

limit_conn addr 2

}

limit_req limit_req_zone $binary_remote_addr z rate= 5r/s;

limit_req_log_level error;

limit_req_status 503;


server {

...

location /{

limit_req z burst=3;

}


}

The above has introduced the nginx current limiting algorithm, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn