High memory consumption in bind 9.18.2

Ondřej Surý ondrej at isc.org
Mon Aug 1 17:17:55 UTC 2022


$ wc -l gen.db
100000000 gen.db

generated with:

#!/bin/env python3

for x in range(0, 10000):
    for y in range(0, 2500):
        print(f"az{x}-{y} IN A 10.53.0.1")
        print(f"bz{x}-{y} IN A 10.53.0.2")
        print(f"ca{x}-{y} IN A 10.53.0.3")
        print(f"xh{x}-{y} IN CNAME az{x}-{y}”)

## BIND 9.16(git)

01-Aug-2022 19:06:27.151 starting BIND 9.16.32-dev (Extended Support Version) <id:c863061a13>
01-Aug-2022 19:06:27.151 running on Linux x86_64 5.10.0-16-amd64 #1 SMP Debian 5.10.127-1 (2022-06-30)
01-Aug-2022 19:06:27.151 built with 'CC=gcc-12' 'LD=' 'CFLAGS=-Ofast -ggdb -Wno-deprecated-declarations -fno-omit-frame-pointer -fno-optimize-sibling-calls -DISC_MEM_USE_INTERNAL_MALLOC=0 -DISC_MEM_TRACKLINES=1' 'LDFLAGS=' '--enable-developer' '--enable-warn-error' '--with-openssl' '--with-zlib' '--with-libxml2' '--with-json-c' '--with-readline' '--with-libidn2' '--enable-dnstap' '--with-libtool' '--without-make-clean' 'PKG_CONFIG_PATH=/home/ondrej/.local/lib/pkgconfig:'
01-Aug-2022 19:06:27.151 running as: named -c named.conf -g -p 12345
01-Aug-2022 19:06:27.151 compiled by GCC 12.0.1 20220319 (experimental) [master r12-7719-g8ca61ad148f]
01-Aug-2022 19:06:27.151 compiled with OpenSSL version: OpenSSL 3.0.5 5 Jul 2022
01-Aug-2022 19:06:27.151 linked to OpenSSL version: OpenSSL 3.0.5 5 Jul 2022
01-Aug-2022 19:06:27.151 compiled with libxml2 version: 2.9.10
01-Aug-2022 19:06:27.151 linked to libxml2 version: 20910
01-Aug-2022 19:06:27.151 compiled with json-c version: 0.15
01-Aug-2022 19:06:27.151 linked to json-c version: 0.15
01-Aug-2022 19:06:27.151 compiled with zlib version: 1.2.11
01-Aug-2022 19:06:27.151 linked to zlib version: 1.2.11

$ smem -P name[d] -a
SWAP:193304 USS:30451812 PSS:30452272 RSS:30454872

## BIND 9.18(git)

01-Aug-2022 18:12:57.227 starting BIND 9.18.6-dev (Stable Release) <id:097a57e>
01-Aug-2022 18:12:57.227 running on Linux x86_64 5.10.0-16-amd64 #1 SMP Debian 5.10.127-1 (2022-06-30)
01-Aug-2022 18:12:57.227 built with  'CC=gcc-12' 'LD=' 'CFLAGS=-Ofast  -ggdb -Wno-deprecated-declarations -fno-omit-frame-pointer -fno-optimize-sibling-calls -DISC_MEM_USE_INTERNAL_MALLOC=0 -DISC_MEM_TRACKLINES=1' 'LDFLAGS=' '--enable-developer' '--enable-warn-error' '--with-openssl' '--with-zlib' '--with-libxml2' '--with-json-c' '--with-readline' '--with-libidn2' '--enable-dnstap' '--with-libtool' '--without-make-clean' 'PKG_CONFIG_PATH=/home/ondrej/.local/lib/pkgconfig:'
01-Aug-2022 18:12:57.227 running as: named -c named.conf -g -p 12345
01-Aug-2022 18:12:57.227 compiled by GCC 12.0.1 20220319 (experimental) [master r12-7719-g8ca61ad148f]
01-Aug-2022 18:12:57.227 compiled with OpenSSL version: OpenSSL 3.0.5 5 Jul 2022
01-Aug-2022 18:12:57.227 linked to OpenSSL version: OpenSSL 3.0.5 5 Jul 2022
01-Aug-2022 18:12:57.227 compiled with libxml2 version: 2.9.10
01-Aug-2022 18:12:57.227 linked to libxml2 version: 20910
01-Aug-2022 18:12:57.227 compiled with json-c version: 0.15
01-Aug-2022 18:12:57.227 linked to json-c version: 0.15
01-Aug-2022 18:12:57.227 compiled with zlib version: 1.2.11
01-Aug-2022 18:12:57.227 linked to zlib version: 1.2.11

$ smem -P name[d] -a
SWAP:645960 USS:29446788 PSS:29447529 RSS:29451056

## BIND 9.19(git)

01-Aug-2022 18:18:20.127 starting BIND 9.19.4-dev (Development Release) <id:fa1f35b>
01-Aug-2022 18:18:20.127 running on Linux x86_64 5.10.0-16-amd64 #1 SMP Debian 5.10.127-1 (2022-06-30)
01-Aug-2022 18:18:20.127 built with  'CC=gcc-12' 'LD=' 'CFLAGS=-Ofast  -ggdb -Wno-deprecated-declarations -fno-omit-frame-pointer -fno-optimize-sibling-calls -DISC_MEM_USE_INTERNAL_MALLOC=0 -DISC_MEM_TRACKLINES=1' 'LDFLAGS=' '--enable-developer' '--enable-warn-error' '--with-openssl' '--with-zlib' '--with-libxml2' '--with-json-c' '--with-readline' '--with-libidn2' '--enable-dnstap' '--with-libtool' '--without-make-clean' 'PKG_CONFIG_PATH=/home/ondrej/.local/lib/pkgconfig:'
01-Aug-2022 18:18:20.127 running as: named -c named.conf -g -p 12345
01-Aug-2022 18:18:20.127 compiled by GCC 12.0.1 20220319 (experimental) [master r12-7719-g8ca61ad148f]
01-Aug-2022 18:18:20.127 compiled with OpenSSL version: OpenSSL 3.0.5 5 Jul 2022
01-Aug-2022 18:18:20.127 linked to OpenSSL version: OpenSSL 3.0.5 5 Jul 2022
01-Aug-2022 18:18:20.127 compiled with libxml2 version: 2.9.10
01-Aug-2022 18:18:20.127 linked to libxml2 version: 20910
01-Aug-2022 18:18:20.127 compiled with json-c version: 0.15
01-Aug-2022 18:18:20.127 linked to json-c version: 0.15
01-Aug-2022 18:18:20.127 compiled with zlib version: 1.2.11
01-Aug-2022 18:18:20.127 linked to zlib version: 1.2.11

$ smem -P name[d] -a
SWAP:1032108 USS:29062164 PSS:29062968 RSS:29066580

So, it’s (USS+Swap):
9.16(git): 30645116
9.18(git): 30092748
9.19(git): 30094272

So, no, I am unable to reproduce the results and yet again, I see a lower memory usage with 9.18+.

But I see a common pattern here. I think both you and the OP were using CentOS/RHEL 7 which is using GCC 4.8.

GCC was improved significantly since then. I would suggest to repeat the experiment on RHEL 9 if you can reproduce the same results.

Ondrej
--
Ondřej Surý (He/Him)
ondrej at isc.org

My working hours and your working hours may be different. Please do not feel obligated to reply outside your normal working hours.

> On 1. 8. 2022, at 17:46, Ondřej Surý <ondrej at isc.org> wrote:
> 
>> On 1. 8. 2022, at 17:19, Dmitri Pavlov <dpavlov at perforce.com> wrote:
>> 
>> I’m pretty much sure you will get the same results in your lab.
> 
> I don’t want to delve into vague description of your experiment. You’ll have to
> share the exact scripts.
> 
> Even this:
> 
>> just the time-consuming task is to generate 100 MIL A + CNAME dummy records into the zone file.
> 
> could be violently different. Are those random names? Or deterministically generated? What are
> the CNAME targets?
> 
> What is the exact `named.conf`?
> 
> What are the exact library versions? What is the exact ./configure invocation?
> 
> How do you execute `named`?
> 
> And yet again - the memory statistics from the statschannel could show the breakdown of the
> internal memory contexts and also show if there’s a difference between the internally reported
> memory usage and externally reported memory usage, e.g. is this something allocated in named,
> or is this allocated in the libraries?
> 
>> Should the memory reduction apply to our experiment?
> 
> The question doesn’t really make sense.  We have not measured any increase in our test scenarios,
> which doesn’t mean you can’t find different scenarios with a memory increase.
> 
> Ondrej
> --
> Ondřej Surý (He/Him)
> ondrej at isc.org
> 
> My working hours and your working hours may be different. Please do not feel obligated to reply outside your normal working hours.
> 



More information about the bind-users mailing list