Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] BIND errors about max open files
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
bombcar
Guru
Guru


Joined: 08 Apr 2003
Posts: 446
Location: Lincoln Acres, CA

PostPosted: Mon Jan 25, 2010 5:31 am    Post subject: [SOLVED] BIND errors about max open files Reply with quote

On my server, I get:

Code:

Jan 24 21:28:16 mail named[9002]: loading configuration from '/etc/bind/named.conf'
Jan 24 21:28:16 mail named[9002]: max open files (1024) is smaller than max sockets (4096)
Jan 24 21:28:16 mail named[9002]: using default UDP/IPv4 port range: [1024, 65535]
Jan 24 21:28:16 mail named[9002]: using default UDP/IPv6 port range: [1024, 65535]


According to a Google search, this was common on 2.6.27 kernels, but I'm running 2.6.31-gentoo-r6. Any ideas on why I'm getting that max open files warning?


Last edited by bombcar on Wed Feb 10, 2010 6:47 am; edited 1 time in total
Back to top
View user's profile Send private message
doctork
Guru
Guru


Joined: 25 Apr 2004
Posts: 370
Location: Cleveland, OH

PostPosted: Mon Jan 25, 2010 6:34 am    Post subject: Reply with quote

I'm running bind-9.6.1_p2 on a X86_64 kernel 2.6.31-gentoo-r6. When it starts, it tells me:
Code:
Jan 25 01:30:43 dwarf named[22495]: adjusted limit on open files from 1024 to 1048576

--
doc
Back to top
View user's profile Send private message
bombcar
Guru
Guru


Joined: 08 Apr 2003
Posts: 446
Location: Lincoln Acres, CA

PostPosted: Wed Feb 10, 2010 6:47 am    Post subject: Reply with quote

I found the solution:


This is caused by the default number of files that a process can run being set very low, to 1024. By default, in include/linux/fs.h:


#define INR_OPEN 1024 /* Initial setting for nfile rlimits */


You could edit that line and recompile your kernel, but that would involve doing that every time a new kernel was released. An easier option is to edit /etc/security/limits.conf, and add the line:


named soft nofile 4096


This sets the default limit for the named user to 4096. Note that you're have to stop and start the named daemon, and not simply run rndc reload, because it needs to actually exit for the changes to take effect. Now the warning will be gone!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum