LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 08-29-2002, 01:30 AM   #1
edreddy
Member
 
Registered: Jul 2002
Location: INDIA, Bangalore.
Distribution: Red Hat Enterprise Linux 3.0 Advanced Server
Posts: 34

Rep: Reputation: 15
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?

Last edited by edreddy; 08-29-2002 at 01:31 AM.
 
Old 08-29-2002, 06:22 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
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).
 
Old 08-31-2002, 02:14 AM   #3
edreddy
Member
 
Registered: Jul 2002
Location: INDIA, Bangalore.
Distribution: Red Hat Enterprise Linux 3.0 Advanced Server
Posts: 34

Original Poster
Rep: Reputation: 15
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.
 
Old 08-31-2002, 02:34 AM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
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

Well, I've just found a nice link: http://support.zeus.com/faq/zws/v4/e...s/linuxfd.html
 
Old 08-31-2002, 04:26 AM   #5
edreddy
Member
 
Registered: Jul 2002
Location: INDIA, Bangalore.
Distribution: Red Hat Enterprise Linux 3.0 Advanced Server
Posts: 34

Original Poster
Rep: Reputation: 15
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.

Last edited by edreddy; 08-31-2002 at 04:30 AM.
 
Old 08-31-2002, 12:35 PM   #6
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
You need to follow instructions from the link I've copied in the previous post. After doing this, you can set the limit as the user.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Process memory limit Costea Linux - Security 9 09-24-2006 01:42 PM
Limit of maximum files/direstories per directory? sindri Linux - Software 3 11-14-2004 11:56 AM
Squid - Maximum time limit per user vkothiyal Linux - Software 0 05-29-2004 07:36 AM
Maximum Memory PER PROCESS anewsome Linux - General 1 03-08-2004 02:29 PM
max process limit anoop_chandran Linux - Networking 2 01-16-2002 05:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration