32-Bit stdio's 256 File-Descriptors Limitation ::: Solaris OS Solutions

We can increase the per-process maximum number of file descriptors in a shell from the default 256 to any value that is less than or equal to the value returned by the command echo

'rlim_fd_max/D' | mdb -k | awk '{ print $2 }'

To adjust the file-descriptor limit in a shell, run
-> in sh/ksh/bash shell ulimit -n

-> in csh shell limit descriptors , where max_file_descriptors is the maximum number of file descriptors you desire.

The default hard limit for the number of files a process can have opened at any time is 65,536. You can tune this limit with the system-tunable parameter rlim_fd_max. Although a very large number of files can be opened by tuning the rlim_fd_max parameter, virtual memory space becomes the limit for 32-bit processes when hundreds of thousands of files are open. When the process reaches the limits of virtual memory, stdio calls fail with a Not enough space error.
(Starting with the Solaris 10 release slated for July 2007, Sun will offer runtime and programming solutions in the form of an extended FILE facility to alleviate stdio's limitation of 256 file descriptors. )

One Excellent article in detail about this limitation & Solution produced by Giri Mandalika, available at sun.com ...in his words
"This article explains in detail the runtime and programming solutions that were introduced under the extended FILE facility. The following discussion is relevant only in 32-bit applications, as 64-bit applications are immune to the limitation to 256 file descriptors".

http://developers.sun.com/solaris/articles/stdio_256.html
(
SDN Home > Solaris > Reference > Technical Articles and Tips > Solaris OS Solutions to 32-Bit stdio's 256 File-Descriptors Limitation)

1 comment :

  1. File descriptors are retired when the file is closed or the process terminates. Opens always choose the lowest-numbered file descriptor available. Available file descriptors are allocated as follows:

    --->rlim_fd_cur: It is dangerous to set this value higher than 256 due to limitations with the stdio library. If programs require more file descriptors, they should use setrlimit directly.

    --->rlim_fd_max: It is dangerous to set this value higher than 1024 due to limitations with select. If programs require more file descriptors, they should use setrlimit directly.

    ReplyDelete