Find the answer to your Linux question:
Results 1 to 6 of 6
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Where to chnage file-max permanently


    Hi all,
    I want to change file-max parameter which is under /proc/sys/fs/file-max.
    I have echoed more value but it is temporary change, where can i cahnge this value permanently.

  2. #2
    hi,

    one easy way to do it is to add the line
    echo "4096" >/proc/sys/fs/file-max
    to the /etc/rc.d/rc.local file so that you need not type it every time your system reboots
    also check out http://www.faqs.org/docs/securing/chap6sec72.html

    regards

  3. #3
    This is from man page of proc,
    check it out for smooth operation.

    /proc/sys/fs/file-max
    This file defines a system-wide limit on the number of open
    files for all processes. (See also setrlimit(2), which can be
    used by a process to set the per-process limit, RLIMIT_NOFILE,
    on the number of files it may open.) If you get lots of error
    messages about running out of file handles, try increasing this
    value:

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

    The kernel constant NR_OPEN imposes an upper limit on the value
    that may be placed in file-max.

    If you increase /proc/sys/fs/file-max, be sure to increase
    /proc/sys/fs/inode-max to 3-4 times the new value of
    /proc/sys/fs/file-max, or you will run out of inodes.

    /proc/sys/fs/inode-max
    This file contains the maximum number of in-memory inodes. On
    some (2.4) systems, it may not be present. This value should be
    3-4 times larger than the value in file-max, since stdin, stdout
    and network sockets also need an inode to handle them. When you
    regularly run out of inodes, you need to increase this value.

    Cheers,
    Tinker.

  4. $spacer_open
    $spacer_close
  5. #4

    Thanks but

    Thanks buddy,
    I have done like that only, but now when u have said abt inode-max, iahve checked for that but it is not there.
    Please suggest.


    Quote Originally Posted by letmeknowlinux
    This is from man page of proc,
    check it out for smooth operation.

    /proc/sys/fs/file-max
    This file defines a system-wide limit on the number of open
    files for all processes. (See also setrlimit(2), which can be
    used by a process to set the per-process limit, RLIMIT_NOFILE,
    on the number of files it may open.) If you get lots of error
    messages about running out of file handles, try increasing this
    value:

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

    The kernel constant NR_OPEN imposes an upper limit on the value
    that may be placed in file-max.

    If you increase /proc/sys/fs/file-max, be sure to increase
    /proc/sys/fs/inode-max to 3-4 times the new value of
    /proc/sys/fs/file-max, or you will run out of inodes.

    /proc/sys/fs/inode-max
    This file contains the maximum number of in-memory inodes. On
    some (2.4) systems, it may not be present. This value should be
    3-4 times larger than the value in file-max, since stdin, stdout
    and network sockets also need an inode to handle them. When you
    regularly run out of inodes, you need to increase this value.

    Cheers,
    Tinker.

  6. #5
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,148
    Can't that be set with ulimit? I'm not at my nix box to check it out, but I usually set limits fro memory,cpu and filesize allocation with ulimit. This in turn can be set in /etc/profile

  7. #6
    Hi,

    Try the following steps to make the file-max value as permanent.


    #echo "fs.file-max = 65536" >> /etc/sysctl.conf

    #sysctl -p

    That's all...


    Cheers,
    Rajesh Kannan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •