1. Check the maximum number of open files in the system #View the current resource limit settings ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 7268 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 7268 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited # View the maximum number of open files in the system ulimit -n 1024 2. Set the maximum limit on the number of files opened by the system #Permanently set the maximum limit on the number of open files in the system vi /etc/security/limits.conf #Add parameters at the end... *soft nofile 102400 * hard nofile 102400 #Temporarily set the maximum limit on the number of open files in the system ulimit -n 102400 #Test operation, whether to permanently load the configuration after restart #System restart init 6 #Test successful, set the maximum limit on the number of open files correctly ulimit -n 102400 3. Set the maximum limit on the number of files opened by nginx vi /usr/local/nginx/conf/nginx.conf user nginx; worker_processes 4; worker_cpu_affinity 0001 0010 0100 1000; worker_rlimit_nofile 102400; ...... #Check if there is any problem with nginx configuration nginx -t nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful #Reload nginx nginx -s reload The maximum number of open files in the system is The maximum limit on the number of open files in nginx should be as consistent as possible Summarize This is the end of this article about configuring the maximum number of files that can be opened by each Nginx process. For more information about the maximum number of files that can be opened by each Nginx process, 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:
|
<<: How to configure MySQL master-slave replication under Windows
>>: Mysql database design three paradigm examples analysis
Table of contents 1. Server 2. Client 3. Testing ...
http://www.cppcns.com/shujuku/mysql/283231.html Y...
1. Key points for early planning of VMware vSpher...
1. HTML font color setting In HTML, we use the fo...
Preface During project development, due to differ...
question First, let me talk about the problem I e...
[LeetCode] 184. Department Highest Salary The Emp...
The <base> tag specifies the default addres...
Table of contents 01-Event Bubbling 1.1- Introduc...
This article records the detailed process of down...
The problems and solutions encountered when deplo...
Table of contents 1. ES syntax getter and setter ...
What is an index? Why create an index? Indexes ar...
Preface This article introduces a simple BAT scri...
Table of contents 1. Install and create an instan...