To change the maximum number of opened files in the ubuntu system

Source: Internet
Author: User
This article describes how to modify the maximum number of files opened by the system in ubuntu. For more information, see Ubuntu.

Step 1: Configure/etc/security/limits. conf

Sudo vim/etc/security/limits. conf
Append at the end of a file

Copy codeThe code is as follows:
* Hard nofile 40960
* Soft nofile 40960

Step 2:/etc/pam. d/su (official) or/etc/pam. d/common-session (network)


Copy codeThe code is as follows:
Sudo vim/etc/pam. d/su

Remove the comments of pam_limits.so.

Copy codeThe code is as follows:
Sudo vim/etc/pam. d/common-session

Add the following line

Copy codeThe code is as follows:
Session required pam_limits.so

Step 3: Configure/etc/profile

Add the last line

Copy codeThe code is as follows:
Ulimit-SHn 40960

Last step: Restart

Ulimit-n verification. if it is displayed as 40960, it is OK.

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.