<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span>We have a resolver on Ubuntu 18.04, using the Ubuntu-packaged bind9 (1:9.11.3+dfsg-1ubuntu1.11).<br>
</span>
<div>The server seems to leak memory, and bind9 needs restarting every couple of weeks.<br>
</div>
<div>If we ignore it then the linux OOM-killer steps up and "handles" the problem for us.<br>
</div>
<div><br>
</div>
<div>We have enabled bind stats like so in /etc/bind/named.conf.options:<br>
</div>
<div><br>
</div>
<div>statistics-channels {<br>
</div>
<div>        inet 127.0.0.1 port 8653 allow { 127.0.0.1; };<br>
</div>
<div>};<br>
</div>
<div><br>
</div>
<div>and have been collecting stats into a zabbix server with the scripts from<br>
</div>
<div>https://github.com/Pesticles/Zabbix-Bind9-Statistics-Collection.<br>
</div>
<div><br>
</div>
<div>I can emit arbitrary stats on demand like so:<br>
</div>
<div><br>
</div>
<div># wget http://localhost:8653 -qO - | xmllint --format - | grep -E 'TreeMemTotal|TotalUse'<br>
</div>
<div>        <counter name="TreeMemTotal">234006180</counter><br>
</div>
<div>        <counter name="TreeMemTotal">287792</counter><br>
</div>
<div>      <TotalUse>16510250005</TotalUse><br>
</div>
<div><br>
</div>
<div>For example, just today, TotalUse has increased from about 4GB at 07:00 to about 15GB at 16:00.<br>
</div>
<div>Also today, TreeMemTotal has increased from about 70MB at 07:00 to about 220MB at 16:00.<br>
</div>
<div><br>
</div>
<div>There are 2 things that I would like more insight into:<br>
</div>
<div><br>
</div>
<div>(1) why is TreeMemTotal (cache tree memory total) constantly increasing?<br>
</div>
<div>    We restart bind9 when it gets over 1GB. This memory use is not reflected<br>
</div>
<div>    in the actual memory use on the machine, as reported by top/free.<br>
</div>
<div><br>
</div>
<div>(2) what is TotalUse measuring? I assumed bytes, but this measure gets<br>
</div>
<div>    over 100GB on a machine with only 2GB RAM, and 10G disk on /var<br>
</div>
<div>    (only 2.3G used), so I wonder if it is measuring something else.<br>
</div>
<div>    It is in the /statistics/memory/summary/ section of the XML emitted<br>
</div>
<div>    on port 8653, so it certainly looks like memory bytes e.g.<br>
</div>
<div>...<br>
</div>
<div>    <summary><br>
</div>
<div>      <TotalUse>16969284048</TotalUse><br>
</div>
<div>      <InUse>170518137</InUse><br>
</div>
<div>      <BlockSize>203685888</BlockSize><br>
</div>
<div>      <ContextSize>7959160</ContextSize><br>
</div>
<div>      <Lost>0</Lost><br>
</div>
<div>    </summary><br>
</div>
<div>  </memory><br>
</div>
<div></statistics><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Thanks,<br>
</div>
<div>Alistair<br>
</div>
<span></span><br>
</div>
<span style="FONT-SIZE: 11px"></span>
<DIV><span style="FONT-SIZE: 11px"><font style="FONT-FAMILY: Verdana; FONT-SIZE: 11px">This email and attachments: are confidential; may be protected by privilege and copyright; if received in error may not be used, copied, or kept; are not guaranteed to be virus-free; may not express the views of Kordia(R); do not designate an information system; and do not give rise to any liability for Kordia(R).</font></span></DIV></body>
</html>