Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 296663

Summary: net-dns/bind-9.4.3-P4 reports "max open files (1024) is smaller than max sockets (4096)"
Product: Gentoo Linux Reporter: Huemi <gentoobugs>
Component: [OLD] UnspecifiedAssignee: Christian Ruppert (idl0r) <idl0r>
Status: RESOLVED WONTFIX    
Severity: normal CC: barzog, bind+disabled, bugs.gentoo.org
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Huemi 2009-12-12 22:27:05 UTC
According to a RedHat bug report this is caused by a kernel bug.
(https://bugzilla.redhat.com/show_bug.cgi?id=477540) 

It seems that this bug hasn't been fixed in gentoo-sources-2.6.31-r6?

It is possible that this issue is a duplicate of a sub-issue of bug 269202, but because it also affects another named version, wasn't the main issue and hasn't been fixed/worked on yet, I report this as a new bug. 

So please don't mark it as duplicate without fixing it. Thanks.

Reproducible: Always

Steps to Reproduce:
Start named and read the output in /var/log/messages. 
Actual Results:  
You will see that named will use up to 4096 sockets, but won't be able to do so, because it can only use 1024 files.

Expected Results:  
Named can use as many files as it needs.
Comment 1 William Waisse 2010-02-02 13:37:51 UTC
same problem here since I upgraded to 
net-dns/bind-9.4.3_p4
Comment 2 William Waisse 2010-02-11 03:40:28 UTC
(In reply to comment #1)
> same problem here since I upgraded to 
> net-dns/bind-9.4.3_p4
> 

 sonmeone found a workaround here : 

http://www.mail-archive.com/freebsd-stable@freebsd.org/msg102398.html

"So I limited the number of sockets named would ask for using this in
/etc/rc.conf:"

named_flags="-4 -S 1024"

 where should I add this in gentoo ( /etc/conf.d ? )

 I dont want to upgrade the kernel just for this small problem

Comment 3 Huemi 2010-02-11 06:42:37 UTC
you could add in /etc/bind/named.conf in the options-section as a workaround:
files 1024;

Remember that you limit the maximum number of open files to 1024, which might have negative side effects when i.e. open libraries also count (maybe 8096 is a better value). 

But this doesn't solve the problem that occurs, when you don't want to limit the maximum number of used files (=unlimited, which is the default).

BTW: you shouldn't only update the kernel to the latest version for small problems, but for security reasons, but it seems that the newest stable gentoo-kernel wouldn't fix the problem with the unlimited files restriction :-(
Comment 4 Huemi 2010-10-26 17:29:24 UTC
Problem is caused by default open files ulimit (try to enter ulimit -n and you see that it is 1024).

Is there a possibility to set in /etc/bind/named.conf in the options-section following value (at least for future versions)?
files 4096;
Comment 5 Christian Ruppert (idl0r) gentoo-dev 2012-05-20 16:33:37 UTC
I don't think we're going to change the default value.
If bind exceeds the limit than either increase it by using limits or use the -S or even files ...; option.