Linux: Increase open files limit

1153075 pts.
Tags:
Linux
When I'm using Linux, I sometimes get this odd error message says I have too many files open. It says that I have a limit of 1024. IS there any way I can increase that?
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TheRealRaven
    It's hard to be sure exactly what you mean because the restriction can relate to Linux itself (and potentially the distro), but also to specific applications that might be configured to set limits.

    I suggest you run a Google search for:
    linux increase open files limit
    Review the results to see what applies to your situation.

    You might try simply running:
    ulimit -n 2048
    Instead of "2048", put the number that you choose. After the command, log off and back on, or restart your system.

    36,420 pointsBadges:
    report
  • Elizine

    Use the following command command to display maximum number of open file descriptors:
    cat /proc/sys/fs/file-max
    Output:

    75000

    75000 files normal user can have open in single login session. To see the hard and soft values, issue the command as follows:
    # ulimit -Hn
    # ulimit -Sn

    To see the hard and soft values for httpd or oracle user, issue the command as follows:
    # su - username
    In this example, su to oracle user, enter:
    # su - oracle
    $ ulimit -Hn
    $ ulimit -Sn

    1,145 pointsBadges:
    report
  • petkoa
    Hi,

    /proc/sys/fs/file-max contains the max number of files in the filesystems available on the host, which has (almost) nothing with the open files limit.

    ulimit is your friend if your root has not set a hard upper limit for regular users in /etc/profile (which a regular user can't override). This is probably not your case, since 1024 is the default soft limit on open files, at least in CentOS 6 I'm using just now.

    Regards,


    3,140 pointsBadges:
    report
  • carlosdl
    Long time no see, Petko!
    85,470 pointsBadges:
    report
  • AjitK29
    As root user you can change the maximum of the open files count per process (via ulimit -n) and per system (e.g. echo 800000 > /proc/sys/fs/file-max).
    2,545 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: