LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 09-22-2011, 08:58 AM   #1
manikumar086
LQ Newbie
 
Registered: Jul 2011
Posts: 15

Rep: Reputation: Disabled
'too many files open' tried 'increasing RLIMIT_NOFILE' but failed...


Hi,
As, i was running a code made using tcl,which opens a file in 'write' mode and after editing/adding prints in it i was closing the file pointer and this entire code is in while loop.

I was facing an error as 'too many files open'

can one help...!!!
 
Old 09-23-2011, 06:19 PM   #2
anishkumarv
Member
 
Registered: Feb 2010
Location: chennai - India
Distribution: centos
Posts: 289

Rep: Reputation: 10
Hi,

I think this problem arrise may be you exceeded the maximum number of filed to be opened,

you just increase the limit and execute.


Code:
ulimit -u unlimited
You must exit and re-login from your terminal for the change to take effect.

Quote:
[root@ANISH] /# ulimit -a


core file size (blocks) 1000000
data seg size (kbytes) unlimited
file size (blocks) unlimited
max memory size (kbytes) unlimited
stack size (kbytes) 8192
cpu time (seconds) unlimited
max user processes unlimited (1)
pipe size (512 bytes) 8
open files 1024
virtual memory (kbytes) 2105343

Make sure that when you type as root the command ulimit -a on your terminal, it shows unlimited next to max user processes.

You may also do ulimit -u unlimited at the command prompt instead of adding it to the /root/.bashrc file.

To increases the number of open files to 60000 for the root account do the following: Edit the .bashrc file vi /root/.bashrc and add the following line:

Code:
ulimit -n 60000

You must exit from your terminal and re-login for the change to take effect.

Quote:
[root@ANISH] /# ulimit -a


core file size (blocks) 1000000
data seg size (kbytes) unlimited
file size (blocks) unlimited
max memory size (kbytes) unlimited
stack size (kbytes) 8192
cpu time (seconds) unlimited
max user processes unlimited
pipe size (512 bytes) 8
open files 60000 (1)
virtual memory (kbytes) 2105343

Make sure that when you type as root the command ulimit -a on your terminal, it shows 60000 next to open files.
 
1 members found this post helpful.
Old 09-23-2011, 06:45 PM   #3
John VV
Guru
 
Registered: Aug 2005
Posts: 13,086

Rep: Reputation: 1748Reputation: 1748Reputation: 1748Reputation: 1748Reputation: 1748Reputation: 1748Reputation: 1748Reputation: 1748Reputation: 1748Reputation: 1748Reputation: 1748
isn't that limit there to STOP a fork bomb !

why not close some of the open files . Or risk locking up the cpu .
 
Old 09-27-2011, 03:03 AM   #4
manikumar086
LQ Newbie
 
Registered: Jul 2011
Posts: 15

Original Poster
Rep: Reputation: Disabled
Thumbs up 'too many files open'

Hi anishkumarv Thanks for your reply...

it was helpful...
 
Old 09-27-2011, 04:56 AM   #5
anishkumarv
Member
 
Registered: Feb 2010
Location: chennai - India
Distribution: centos
Posts: 289

Rep: Reputation: 10
Hi manikumar086,

:-) If this thread solved kindly marked this as solved...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh -L '>channel 3: open failed: connect failed:' Luke771 Linux - Networking 14 01-24-2012 03:14 AM
ssh -D "channel 6: open failed: administratively prohibited: open failed" 1veedo Linux - Networking 1 06-24-2009 09:23 PM
LXer: Bulgaria: 'Government's increasing use of Open Source inevitable' LXer Syndicated Linux News 0 06-09-2008 08:40 AM
LXer: Norway increasing use of open-source software LXer Syndicated Linux News 0 04-07-2006 05:33 PM


All times are GMT -5. The time now is 05:20 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration