When using Linux as a service runtime environment, there are some performance bottlenecks, because the system defaults to a lower value, typically 1024, it is easy to cause insufficient resources, cannot create a process, or cannot open a file.
First, use Ulimit-a to view system Ulimit settings
ulimit -acore file size (blocks,  -C) 0data seg size ( kbytes, -d) unlimitedscheduling priority (-E) 0file size (blocks, -f) unlimitedpending signals (-i) 127438max locked memory (kbytes, -l) unlimitedmax memory size (kbytes, -m) unlimitedopen files (-N) 1048576pipe size (512 bytes,  -P) 8POSIX message queues (bytes, -q) 819200real-time priority (-R) 0stack size (kbytes, -s) 10240cpu time (SECONDS, -T) unlimitedmax user processes (-u) 10240virtual memory (KBYTES, -V) unlimitedfile locks (-X) unlimited
Second, the parameter meaning
-N is the number of file handles, representing the number of files that the program can open, by default 1024
-u user maximum number of threads, default is 1024
Third, modify the configuration
Method One: Ulimit-n 102400
This method is valid only for the current terminal and will be restored after re-login or reboot
Method Two: Write the configuration to the configuration file ~/.BASHRC or/etc/profile
Method Three: Modify the configuration (recommended)
1, modify the Ulimit-n
vi/etc/security/limits.conf* soft nofile 1048576* hard Nofile 10485 76
2, modify the Ulimit-u
vi/etc/security/limits.d/90-nproc.conf# Default limit for number of user ' s processes to prevent# accidental fork bombs.# See Rhbz #432903 for reasoning.* soft nproc 40960root Soft Nproc Unlimited
This article is from the "Talent" blog, make sure to keep this source http://4988084.blog.51cto.com/4978084/1863734
Linux Setup System ulimit