Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Red Hat Enterprise Linux 3.0 Advanced Server
Posts: 34
Rep:
process wide limit on Maximum file desriptors
hey guys!
I am working on an high end application which requires many files to be opened by a single process.
I am using linux kernel 2.4.2-2. It is restricting me to open only 1024 files by a single process. but one of processes in my application requires 3000 files to be opened at at one particular point of time. so the open () system call is failed at this point.
Hence, my requirement is to tune the parameter that deals with no. of maximum files that can be opened by a process.
So, question is where can I tune this parameter -- is it in any header file or through any kernel parameter.
If it is is header file, what is the header file and parameter name?
and If it is through system command, what is the command, its syntax and parameters.
I need it in urgent. can any one of you guys help me out?
To increase the number use:
echo "value">/proc/sys/fs/file-max
You may also need to increas limit for the user your program is running as (using 'ulimit' command).
Distribution: Red Hat Enterprise Linux 3.0 Advanced Server
Posts: 34
Original Poster
Rep:
Mara,
I tried with
echo 4000 > /proc/sys/fs/file-max
command.
but it doesn't work. it seems that /proces/sys/fs/file-max file contains total system wide limit on total number of files to be opened.
I don't know how to use ulimit command to increase user space for processes. can you elaborate on this.
is there any way we can tune file-max parameter using sysctl command.
I forgot tha there's no man page for ulimit, sorry.
Logges as a normal user run
ulimit -a
This gives you (among other things) number of desctiptors for the user.
You set the limit using
ulimit -n number
Distribution: Red Hat Enterprise Linux 3.0 Advanced Server
Posts: 34
Original Poster
Rep:
mara,
yeah, I logged in as normal user and using the command
ulimit -a
i come to know that 1024 is the limit on the file descriotors for me.
but now if i try to issue the command
ulimit -n 4000
( as a normal user) it is giving me error
"bash : ullimit: cannot modify limit : operation not permitted"
but as a root user, I am able to change that limit for root himself only, using the same command " ulimit -n 4000" . but this is in effect for only for that login session of root user.
any way I am Unable to change it for normal user. how can it be solved.
Is theee any way root user can modify above limit for other users using ulimit cammand or any other command.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.