Introduction The module that limits the number of concurrent connections is: http_limit_conn_module, address: http://nginx.org/en/docs/http/ngx_http_limit_conn_module.html The module that limits the number of concurrent requests is: http_limit_req_module, address: http://nginx.org/en/docs/http/ngx_http_limit_req_module.html Both modules are compiled into Nginx by default. Limit the number of concurrent connections Example configuration: http { limit_conn_zone $binary_remote_addr zone=addr:10m; #limit_conn_zone $server_name zone=perserver:10m; server { limit_conn addr 1; limit_conn_log_level warn; limit_conn_status 503; } } limit_conn_zone key zone=name:size; defines the configuration of concurrent connections
limit_conn zone number; concurrent connection limit
limit_conn_log_level info | notice | warn | error ; Log level when limit occurs
limit_conn_status code; the error code returned when a limit occurs, the default is 503
Limit the number of concurrent requests limit_req_zone key zone=name:size rate=rate; Defines the configuration for limiting concurrent requests.
limit_req zone=name [burst=number] [nodelay | delay=number];
limit_req_log_level info | notice | warn | error; Log level when limit occurs
limit_req_status code ; error code when a limit occurs
Example Configuration 1 http { limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; limit_req zone=one burst=5; } The request rate is 1 request delivered per second. The burst bucket size can store 5 requests. Requests exceeding the limit will return an error. Example Configuration 2 http { limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; limit_req zone=one burst=5 nodelay; } Example configuration 2 adds the Example Configuration 3 http { limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; limit_req zone=one burst=5 delay=3; } Example configuration 3 adds This is the end of this article about how to limit the number of concurrent connection requests in nginx. For more information about how to limit the number of concurrent connection requests in nginx, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Summary of common Mysql DDL operations
>>: Commonly used JavaScript array methods
Similar to the code hosting service provided by G...
letter-spacing property : Increase or decrease th...
MySQL 5.7.18 installation and problem summary. I ...
View historical commands and execute specified co...
The database installation tutorial of MySQL-8.0.2...
Web forms are the primary communication channel b...
In SQL, GROUP BY is used to group data in the res...
Method 1: Use Google advanced search, for example...
Use canvas to create graphics and text with shado...
view What is a view? What is the role of a view? ...
This article example shares the specific code of ...
1. Introduction As we all know, in the applicatio...
It was found in the test that when the page defini...
This article describes how to export and import ....
When using <a href="" onclick="&...