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
Table of contents 1.watch monitors changes in gen...
Solution Abandon the Linux virtual machine that c...
Preface: I have often heard about database paradi...
This article introduces an example of using HTML+...
The so-called sliding door technology means that ...
Application scenario 1: Domain name-based redirec...
What is CSS# CSS (abbreviation of Cascading Style...
react-native installation process 1.npx react-nat...
Table of contents 1. Timer monitoring 2. Event mo...
Today I saw a blog post about input events, and o...
1. Introduction I have taken over a project of th...
Linux basic configuration Compile and install pyt...
This article example shares the specific code of ...
With the development of Internet technology, user...
【question】 The INSERT statement is one of the mos...