Set the Ulimit value (number of Linux file handles) to take effect permanently __linux

Source: Internet
Author: User

Set Ulimit value (number of Linux file handles) permanently in effect

Inux default number of open files Linux defaults to 1024 open files, through ulimit-a You can view open files

Modify this limit to use Ulimt-shn 65536

The following settings are required for permanent entry:

1./etc/pam.d/login Add pam_limits.so (sometimes the system defaults to add)

First find the specific location of the file by finding/-name pam_limits.so

Session required/lib/security/pam_limits.so

2./etc/security/limits.conf add

Www-nofile 1006154

www is a user, if you want all users to take effect to replace the *, set the value of the hardware configuration, do not set too large.

* Soft Nofile 65536

* Hard Nofile 65536

3. Modify/etc/rc.local Add

echo 8061540 >/proc/sys/fs/file-max

(The data here is adjusted according to your actual needs)


The practical problem solved by this method is that the number of open files in Squid,mysql will exceed the process limit of the system and cause the bottleneck of the system in the high load.

Http://blog.sina.com.cn/s/blog_520fb00d0100hnso.html

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.