Maximum number of file links modified in linux: openfiles/ulimit-n

Source: Internet
Author: User
In linux, you can modify the maximum number of file links openfilesulimit-n using ulimit-a to view all the restrictions of the current system. you can use ulimit-n to view the maximum number of opened files. By default, only 1024 of newly installed linux instances are used as servers with large loads, in linux, you can easily modify the maximum number of file links. open files/ulimit-n can be used to view all the limit values of the current system, you can use ulimit-n to view the maximum number of opened files. By default, only 1024 of newly installed linux instances are installed. when used as a server with a large load, it is easy to encounter error: too program open files. Therefore, you need to increase it. You can use ulimit-n 65535 to modify it in real time, but it becomes invalid after restart. (Note that ulimit-SHn 65535 is equivalent to ulimit-n 65535,-S refers to soft, and-H refers to hard) there are three ways to modify it: 1. in/etc/rc. add a ulimit-SHn 655352 line in local. add a ulimit-SHn 655353 row to/etc/profile. in/etc/security/limits. in conf, add the following two lines of records * soft nofile 65535 * hard nofile 65535, which one is used? which one is valid? in CentOS, 1st methods are ineffective, in Debian, the CentOS ulimit command has the hardware and software settings, and The-H command is hard, adding-S indicates that the soft limit is displayed by default. if the CentOS ulimit command is not added during modification, the two parameters are changed together. after the modification takes effect, log on again. (My system is Cent. OS5.1. modified, and it will take effect immediately after you log on again. you can use CentOS ulimit-a to check and confirm.) [root @ dev ~] # Ulimit-acore file size (blocks,-c) 0 data seg size (kbytes,-d) unlimitedscheduling priority (-e) 0 file size (blocks,-f) unlimitedpending signals (-I) 17513max locked memory (kbytes,-l) 32max memory size (kbytes,-m) unlimitedopen files (-n) 65535 pipe size (512 bytes,-p) 8 POSIX message queues (bytes,-q) 819200real-time priority (-r) 0 stack size (kbytes,-s) 10240cpu time (seconds,-t) unlimitedmax user processes (-u) 17513 virtual memory (kbytes,-v) unlimitedfile locks (-x) unlimited
 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.