From owner-freebsd-questions@freebsd.org Thu Sep 2 08:32:58 2021 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2AA067B6A0 for ; Thu, 2 Sep 2021 08:32:58 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H0Z1k4xQhz4V1Q for ; Thu, 2 Sep 2021 08:32:58 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.117.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "R3" (verified OK)) (Authenticated sender: matthew/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 76AD9B61 for ; Thu, 2 Sep 2021 08:32:58 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from PD0786.local (unknown [IPv6:2001:8b0:151:1:e84f:8889:ff36:826e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id 67E495D6A for ; Thu, 2 Sep 2021 08:32:56 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/67E495D6A; dkim=none; dkim-atps=neutral Subject: Re: BIND 'max-cache-size' Value on FreeBSD-13.0 To: freebsd-questions@freebsd.org References: From: Matthew Seaman Message-ID: <57a5c2ef-87c1-dd1a-775e-acae89b0bbbc@FreeBSD.org> Date: Thu, 2 Sep 2021 09:32:55 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Sep 2021 08:32:58 -0000 On 02/09/2021 09:13, Mark Tinka wrote: > Hi all. > > Ever since we moved from BIND-9.11 to BIND-9.16, we've been experiencing > 'named' crashing after 24hrs - 36hrs on high-load resolver-only servers, > running on FreeBSD-13.0. > > We found that the reason for this was due to BIND running out of swap > space. > > An increase in swap space by creating a 4GB swap file did not help. > > So we are now playing with the 'max-cache-size' value in BIND. The > system has 15GB of physical RAM. Limiting BIND to 13GB of memory does > not work; 'named' still crashes due to a lack of swap space. > > We have then switched to % values, and it's still crashing for the same > reason at 90% and now 80%. > > We are now testing 70%. > > Anyone have some idea of how we can get this under control? > > Is there a possibility that BIND is not properly understanding how much > physical RAM is available to FreeBSD, and just burns through it anyway, > tripping swap space in the process? I can't think of any reason why BIND > would keep burning RAM if it has been told to limit its demand to a > certain value or %. > > All help appreciated. Thanks. Hmmm.... unlike many big opensource groups, ISC has traditionally used FreeBSD extensively as a development platform, so they should be on top of the differences between FreeBSD and Linux with regard to memory management. You've clearly got some sort of memory leak, which you are attributing to bind not managing its cache correctly. I think that may possibly be a red-herring, and the leak is occurring in some other aspect of bind operation. But what that might be I have no idea. I suggest asking on the bind-users@lists.isc.org mailing list, as that's where the ISC devs and many bind specialists hang out. Cheers, Matthew