Adjust the maximum Linux file descriptor for a process

Source: Internet
Author: User

1. Introduction

The ulimit command provides control over the resource that is consumed by the shell and or by the process that the shell initiates.

The persistence modification takes effect to write data in /etc/security/limits.conf .

The written format is:<domain><type><item><value>

Domain: username/user Group name/other (View man limits.conf)

Type:hard/soft, respectively, refers to the actual maximum type and the alert value type, one is Max, one is threshold, and warning is generated in threshold.

item:core/data/fsize/memlock/nofile/rss/stack/cpu/nproc/as/maxlogins/maxsyslogins/priority/locks/ sigpending/msgqueue/nice/rtprio/

Value: -1/unlimited/infinity/ Specific Value

To modify the maximum file descriptor , focus on item and value

2. Modifications

2.1 View the current user maximum number of file descriptors first:

1 ulimit-Hn2 ulimit-sn

2.2 Modify the maximum number of file descriptors for the current user process:

1 vim/etc/security/limits.conf2 add 3 user soft    nofile  at the end 4096 (user name) 4 User  hard   nofile  102405 Save log out and then log back in 6

Adjust the maximum Linux file descriptor for a process

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.