LinuxQuestions.org
Help answer threads with 0 replies.
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 02-16-2006, 07:50 PM   #1
thetawaverider
Member
 
Registered: Feb 2006
Distribution: CentOS
Posts: 47

Rep: Reputation: 15
Increasing file descriptor limit


Hello,

The Apache server I'm administering has about 500+ virtual hosts on it (I know, it's alot, but the owner wants them all here), and it will not start due to the OS file descriptor limit being reached. I'm currently testing the solution on my virtual machine. Here is what I've done:

1. Edit /etc/security/limits.conf and add the lines:

* soft nofile 1024
* hard nofile 65535

2. Edit /etc/pam.d/login, adding the line:

session required /lib/security/pam_limits.so

3. Run the following:

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

4. Run the following:

ulimit -n unlimited


From the info I've googled, the last command should set the limits to the hard limit specified in /etc/security/limits.conf. However, when I run it, I get the message:

bash: ulimit: open files: cannot modify limit: Operation not permitted

I'm logged in as root. I've also already checked the forums here, and most responses either include a file I don't have (I'm on Fedora Core 4) or include the aforementioned steps (in whole or in part).

If anyone could shed some light here, I'd be grateful.

Thanks,
TWR
 
Old 02-16-2006, 08:45 PM   #2
mhiggins
Member
 
Registered: Feb 2004
Posts: 140

Rep: Reputation: 15
You want to set the file-max as you did above but then make the ulimit call = to the value you put in the file-max proc entry. Also note that the ulimt call should be done in the script that starts apache.

That should do the trick.
 
Old 02-16-2006, 09:10 PM   #3
thetawaverider
Member
 
Registered: Feb 2006
Distribution: CentOS
Posts: 47

Original Poster
Rep: Reputation: 15
Yes, that makes sense. I shouldn't be able to set the limit higher than the values I defined earlier.

Thanks.
 
  


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
Get the absolute path of file using file descriptor. appas Programming 7 01-19-2012 11:47 AM
Low open file descriptor limit Suse 9.2 kryten SUSE / openSUSE 3 12-20-2004 12:20 AM
File Descriptor Limit rbd Linux - General 3 10-11-2004 01:57 PM
apt-file returns nothing; 'bad file descriptor' overbored Debian 3 10-03-2004 09:13 PM
Descriptor limit for a process akuate Linux - General 0 08-18-2004 11:23 AM

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

All times are GMT -5. The time now is 09:16 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