Home > Article > Backend Development > nginx current limiting algorithm
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.