Significant memory usage
Philip Prindeville
philipp_subx at redfish-solutions.com
Sun Jun 8 20:44:44 UTC 2025
> On May 21, 2025, at 3:38 PM, Ben Scott <bscott at isc.org> wrote:
>
> ----- Original Message -----
>> From: "Philip Prindeville via bind-users"
>> To: "bind-users"
>> Sent: Sunday, May 18, 2025 5:20:59 PM
>> Subject: Significant memory usage
>
>> What I’ve noticed is that at startup I’m using about 33K pages as the VSZ (per
>> top on x86_64 hardware).
>
> VSZ (virtual size) just counts the number of virtual memory pages associated with the process in some way. That includes RAM, but also memory mapped files, devices, sparse pages that will never be backed by anything, etc. You need to look at RSS (resident size) to monitor actual RAM usage.
>
> The results of "rdnc stats" and/or the "statistics-channels" will provide BIND-specific statistics. The former can be run without preparation; the latter is a bit friendlier but needs a config change.
>
> https://kb.isc.org/docs/monitoring-recommendations-for-bind-9
>
> https://kb.isc.org/docs/aa-00769
>
> https://kb.isc.org/docs/aa-01123
>
> — Ben
>
I’m currently doing an “rndc flush” every hour to stop my system from getting exhausted. I’ll disable that and report back in a few hours.
Also trying to port jemalloc to Openwrt and rebuild Bind against that. Would have done this sooner but there was a Strongswan issue that took precedence.
But for now I’m seeing:
+++ Statistics Dump +++ (1749414883)
++ Incoming Requests ++
202350 QUERY
866925 UPDATE
++ Incoming Queries ++
100752 A
726 NS
11 CNAME
3286 SOA
2040 PTR
287 MX
4243 TXT
59691 AAAA
3938 SRV
1112 NAPTR
2 DNSKEY
5043 SVCB
21219 HTTPS
++ Outgoing Rcodes ++
713834 NOERROR
1146 SERVFAIL
52791 NXDOMAIN
25 REFUSED
288430 YXDOMAIN
++ Outgoing Queries ++
[View: default]
102499 A
53762 NS
281 CNAME
95 SOA
266 PTR
189 MX
1581 TXT
21112 AAAA
233 SRV
227 NAPTR
9372 DS
2623 DNSKEY
17076 HTTPS
[View: _bind]
++ Name Server Statistics ++
1069275 IPv4 requests received
24143 requests with EDNS(0) received
868523 requests with TSIG received
3377 TCP requests received
2 TCP connection high-water
25 update requests rejected
1056226 responses sent
415 truncated responses sent
24143 responses with EDNS(0) sent
868523 responses with TSIG sent
117485 queries resulted in successful answer
42841 queries resulted in authoritative answer
145314 queries resulted in non authoritative answer
17879 queries resulted in nxrrset
1146 queries resulted in SERVFAIL
52791 queries resulted in NXDOMAIN
90820 queries caused recursion
13049 duplicate queries received
578470 updates completed
288430 updates failed
288430 updates rejected due to prerequisite failure
105 Recursive clients high-water
199789 UDP queries received
1809 TCP queries received
1 COOKIE option received
1 COOKIE - client only
199 synthesized a NXDOMAIN response
2 synthesized a no-data response
1377 queries triggered prefetch
++ Zone Maintenance Statistics ++
2 IPv4 notifies sent
++ Resolver Statistics ++
[Common]
[View: default]
209316 IPv4 queries sent
208247 IPv4 responses received
14032 NXDOMAIN received
2 SERVFAIL received
6 FORMERR received
6 EDNS(0) query failures
449 truncated responses received
66912 query retries
1003 query timeouts
32195 IPv4 NS address fetches
30 IPv4 NS address fetch failed
143548 DNSSEC validation attempted
91201 DNSSEC validation succeeded
52343 DNSSEC NX validation succeeded
4 DNSSEC validation failed
198192 queries with RTT 10-100ms
10027 queries with RTT 100-500ms
8 queries with RTT 500-800ms
13 queries with RTT 800-1600ms
7 queries with RTT > 1600ms
2 bucket size
69 REFUSED received
203461 COOKIE send with client cookie only
5849 COOKIE sent with client and server cookie
15628 COOKIE replies received
14790 COOKIE client ok
152 bad cookie rcode
68 priming queries
[View: _bind]
2 bucket size
++ Cache Statistics ++
[View: default]
1281544 cache hits
3606 cache misses
343955 cache hits (from query)
143329 cache misses (from query)
0 cache records deleted due to memory exhaustion
33915 cache records deleted due to TTL expiration
123929 covering nsec returned
1415 cache database nodes
2 cache NSEC auxiliary database nodes
0 cache database hash buckets
750446 cache tree memory in use
32880 cache heap memory in use
[View: _bind (Cache: _bind)]
0 cache hits
0 cache misses
0 cache hits (from query)
0 cache misses (from query)
0 cache records deleted due to memory exhaustion
0 cache records deleted due to TTL expiration
0 covering nsec returned
0 cache database nodes
0 cache NSEC auxiliary database nodes
0 cache database hash buckets
38570 cache tree memory in use
112 cache heap memory in use
++ Cache DB RRsets ++
[View: default]
1029 A
251 NS
89 CNAME
8 SOA
5 TXT
647 AAAA
14 DS
52 RRSIG
2 NSEC
9 DNSKEY
3 HTTPS
48 !NS
2 !TXT
15 !AAAA
1 !NAPTR
47 !DS
16 !HTTPS
11 NXDOMAIN
[View: _bind (Cache: _bind)]
++ ADB stats ++
[View: default]
899 Addresses in hash table
1043 Names in hash table
[View: _bind]
++ Socket I/O Statistics ++
208951 UDP/IPv4 sockets opened
460 TCP/IPv4 sockets opened
208943 UDP/IPv4 sockets closed
3893 TCP/IPv4 sockets closed
48 UDP/IPv4 socket bind failures
102 UDP/IPv4 socket connect failures
3 TCP/IPv4 socket connect failures
208868 UDP/IPv4 connections established
448 TCP/IPv4 connections established
3443 TCP/IPv4 connections accepted
64 UDP/IPv4 send errors
12 UDP/IPv4 sockets active
15 TCP/IPv4 sockets active
++ Per Zone Query Statistics ++
++ Per Zone Glue Cache Statistics ++
[localhost]
[127.in-addr.arpa]
[0.in-addr.arpa]
[255.in-addr.arpa]
[tiktok.com]
[.]
[10.IN-ADDR.ARPA]
[16.172.IN-ADDR.ARPA]
[17.172.IN-ADDR.ARPA]
[18.172.IN-ADDR.ARPA]
[19.172.IN-ADDR.ARPA]
[20.172.IN-ADDR.ARPA]
[21.172.IN-ADDR.ARPA]
[22.172.IN-ADDR.ARPA]
[23.172.IN-ADDR.ARPA]
[24.172.IN-ADDR.ARPA]
[25.172.IN-ADDR.ARPA]
[26.172.IN-ADDR.ARPA]
[27.172.IN-ADDR.ARPA]
[28.172.IN-ADDR.ARPA]
[29.172.IN-ADDR.ARPA]
[30.172.IN-ADDR.ARPA]
[31.172.IN-ADDR.ARPA]
[64.100.IN-ADDR.ARPA]
[65.100.IN-ADDR.ARPA]
[66.100.IN-ADDR.ARPA]
[67.100.IN-ADDR.ARPA]
[68.100.IN-ADDR.ARPA]
[69.100.IN-ADDR.ARPA]
[70.100.IN-ADDR.ARPA]
[71.100.IN-ADDR.ARPA]
[72.100.IN-ADDR.ARPA]
[73.100.IN-ADDR.ARPA]
[74.100.IN-ADDR.ARPA]
[75.100.IN-ADDR.ARPA]
[76.100.IN-ADDR.ARPA]
[77.100.IN-ADDR.ARPA]
[78.100.IN-ADDR.ARPA]
[79.100.IN-ADDR.ARPA]
[80.100.IN-ADDR.ARPA]
[81.100.IN-ADDR.ARPA]
[82.100.IN-ADDR.ARPA]
[83.100.IN-ADDR.ARPA]
[84.100.IN-ADDR.ARPA]
[85.100.IN-ADDR.ARPA]
[86.100.IN-ADDR.ARPA]
[87.100.IN-ADDR.ARPA]
[88.100.IN-ADDR.ARPA]
[89.100.IN-ADDR.ARPA]
[90.100.IN-ADDR.ARPA]
[91.100.IN-ADDR.ARPA]
[92.100.IN-ADDR.ARPA]
[93.100.IN-ADDR.ARPA]
[94.100.IN-ADDR.ARPA]
[95.100.IN-ADDR.ARPA]
[96.100.IN-ADDR.ARPA]
[97.100.IN-ADDR.ARPA]
[98.100.IN-ADDR.ARPA]
[99.100.IN-ADDR.ARPA]
[100.100.IN-ADDR.ARPA]
[101.100.IN-ADDR.ARPA]
[102.100.IN-ADDR.ARPA]
[103.100.IN-ADDR.ARPA]
[104.100.IN-ADDR.ARPA]
[105.100.IN-ADDR.ARPA]
[106.100.IN-ADDR.ARPA]
[107.100.IN-ADDR.ARPA]
[108.100.IN-ADDR.ARPA]
[109.100.IN-ADDR.ARPA]
[110.100.IN-ADDR.ARPA]
[111.100.IN-ADDR.ARPA]
[112.100.IN-ADDR.ARPA]
[113.100.IN-ADDR.ARPA]
[114.100.IN-ADDR.ARPA]
[115.100.IN-ADDR.ARPA]
[116.100.IN-ADDR.ARPA]
[117.100.IN-ADDR.ARPA]
[118.100.IN-ADDR.ARPA]
[119.100.IN-ADDR.ARPA]
[120.100.IN-ADDR.ARPA]
[121.100.IN-ADDR.ARPA]
[122.100.IN-ADDR.ARPA]
[123.100.IN-ADDR.ARPA]
[124.100.IN-ADDR.ARPA]
[125.100.IN-ADDR.ARPA]
[126.100.IN-ADDR.ARPA]
[127.100.IN-ADDR.ARPA]
[254.169.IN-ADDR.ARPA]
[2.0.192.IN-ADDR.ARPA]
[100.51.198.IN-ADDR.ARPA]
[113.0.203.IN-ADDR.ARPA]
[255.255.255.255.IN-ADDR.ARPA]
[0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA]
[1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA]
[D.F.IP6.ARPA]
[8.E.F.IP6.ARPA]
[9.E.F.IP6.ARPA]
[A.E.F.IP6.ARPA]
[B.E.F.IP6.ARPA]
[8.B.D.0.1.0.0.2.IP6.ARPA]
[EMPTY.AS112.ARPA]
[HOME.ARPA]
[RESOLVER.ARPA]
[version.bind (view: _bind)]
[hostname.bind (view: _bind)]
[authors.bind (view: _bind)]
[id.server (view: _bind)]
[redfish-solutions.com]
[168.192.in-addr.arpa]
--- Statistics Dump --- (1749414883)
+++ Statistics Dump +++ (1749414921)
++ Incoming Requests ++
202427 QUERY
866964 UPDATE
++ Incoming Queries ++
100791 A
726 NS
11 CNAME
3287 SOA
2040 PTR
287 MX
4243 TXT
59714 AAAA
3939 SRV
1113 NAPTR
2 DNSKEY
5046 SVCB
21228 HTTPS
++ Outgoing Rcodes ++
713932 NOERROR
1146 SERVFAIL
52796 NXDOMAIN
25 REFUSED
288443 YXDOMAIN
++ Outgoing Queries ++
[View: default]
102535 A
53774 NS
281 CNAME
95 SOA
266 PTR
189 MX
1581 TXT
21115 AAAA
233 SRV
227 NAPTR
9375 DS
2623 DNSKEY
17081 HTTPS
[View: _bind]
++ Name Server Statistics ++
1069391 IPv4 requests received
24143 requests with EDNS(0) received
868562 requests with TSIG received
3377 TCP requests received
2 TCP connection high-water
25 update requests rejected
1056342 responses sent
415 truncated responses sent
24143 responses with EDNS(0) sent
868562 responses with TSIG sent
117550 queries resulted in successful answer
42844 queries resulted in authoritative answer
145388 queries resulted in non authoritative answer
17886 queries resulted in nxrrset
1146 queries resulted in SERVFAIL
52796 queries resulted in NXDOMAIN
90848 queries caused recursion
13049 duplicate queries received
578496 updates completed
288443 updates failed
288443 updates rejected due to prerequisite failure
105 Recursive clients high-water
199866 UDP queries received
1809 TCP queries received
1 COOKIE option received
1 COOKIE - client only
199 synthesized a NXDOMAIN response
2 synthesized a no-data response
1378 queries triggered prefetch
++ Zone Maintenance Statistics ++
2 IPv4 notifies sent
++ Resolver Statistics ++
[Common]
[View: default]
209375 IPv4 queries sent
208306 IPv4 responses received
14032 NXDOMAIN received
2 SERVFAIL received
6 FORMERR received
6 EDNS(0) query failures
449 truncated responses received
66931 query retries
1003 query timeouts
32209 IPv4 NS address fetches
30 IPv4 NS address fetch failed
143588 DNSSEC validation attempted
91228 DNSSEC validation succeeded
52356 DNSSEC NX validation succeeded
4 DNSSEC validation failed
198251 queries with RTT 10-100ms
10027 queries with RTT 100-500ms
8 queries with RTT 500-800ms
13 queries with RTT 800-1600ms
7 queries with RTT > 1600ms
2 bucket size
69 REFUSED received
203520 COOKIE send with client cookie only
5849 COOKIE sent with client and server cookie
15628 COOKIE replies received
14790 COOKIE client ok
152 bad cookie rcode
68 priming queries
[View: _bind]
2 bucket size
++ Cache Statistics ++
[View: default]
1282030 cache hits
3606 cache misses
344145 cache hits (from query)
143364 cache misses (from query)
0 cache records deleted due to memory exhaustion
33915 cache records deleted due to TTL expiration
123962 covering nsec returned
1452 cache database nodes
2 cache NSEC auxiliary database nodes
0 cache database hash buckets
768258 cache tree memory in use
32880 cache heap memory in use
[View: _bind (Cache: _bind)]
0 cache hits
0 cache misses
0 cache hits (from query)
0 cache misses (from query)
0 cache records deleted due to memory exhaustion
0 cache records deleted due to TTL expiration
0 covering nsec returned
0 cache database nodes
0 cache NSEC auxiliary database nodes
0 cache database hash buckets
38570 cache tree memory in use
112 cache heap memory in use
++ Cache DB RRsets ++
[View: default]
1052 A
256 NS
94 CNAME
8 SOA
5 TXT
647 AAAA
14 DS
58 RRSIG
2 NSEC
9 DNSKEY
4 HTTPS
50 !NS
2 !TXT
16 !AAAA
1 !NAPTR
50 !DS
20 !HTTPS
11 NXDOMAIN
[View: _bind (Cache: _bind)]
++ ADB stats ++
[View: default]
913 Addresses in hash table
1063 Names in hash table
[View: _bind]
++ Socket I/O Statistics ++
209010 UDP/IPv4 sockets opened
460 TCP/IPv4 sockets opened
209002 UDP/IPv4 sockets closed
3894 TCP/IPv4 sockets closed
48 UDP/IPv4 socket bind failures
102 UDP/IPv4 socket connect failures
3 TCP/IPv4 socket connect failures
208927 UDP/IPv4 connections established
448 TCP/IPv4 connections established
3444 TCP/IPv4 connections accepted
64 UDP/IPv4 send errors
12 UDP/IPv4 sockets active
15 TCP/IPv4 sockets active
++ Per Zone Query Statistics ++
++ Per Zone Glue Cache Statistics ++
[localhost]
[127.in-addr.arpa]
[0.in-addr.arpa]
[255.in-addr.arpa]
[tiktok.com]
[.]
[10.IN-ADDR.ARPA]
[16.172.IN-ADDR.ARPA]
[17.172.IN-ADDR.ARPA]
[18.172.IN-ADDR.ARPA]
[19.172.IN-ADDR.ARPA]
[20.172.IN-ADDR.ARPA]
[21.172.IN-ADDR.ARPA]
[22.172.IN-ADDR.ARPA]
[23.172.IN-ADDR.ARPA]
[24.172.IN-ADDR.ARPA]
[25.172.IN-ADDR.ARPA]
[26.172.IN-ADDR.ARPA]
[27.172.IN-ADDR.ARPA]
[28.172.IN-ADDR.ARPA]
[29.172.IN-ADDR.ARPA]
[30.172.IN-ADDR.ARPA]
[31.172.IN-ADDR.ARPA]
[64.100.IN-ADDR.ARPA]
[65.100.IN-ADDR.ARPA]
[66.100.IN-ADDR.ARPA]
[67.100.IN-ADDR.ARPA]
[68.100.IN-ADDR.ARPA]
[69.100.IN-ADDR.ARPA]
[70.100.IN-ADDR.ARPA]
[71.100.IN-ADDR.ARPA]
[72.100.IN-ADDR.ARPA]
[73.100.IN-ADDR.ARPA]
[74.100.IN-ADDR.ARPA]
[75.100.IN-ADDR.ARPA]
[76.100.IN-ADDR.ARPA]
[77.100.IN-ADDR.ARPA]
[78.100.IN-ADDR.ARPA]
[79.100.IN-ADDR.ARPA]
[80.100.IN-ADDR.ARPA]
[81.100.IN-ADDR.ARPA]
[82.100.IN-ADDR.ARPA]
[83.100.IN-ADDR.ARPA]
[84.100.IN-ADDR.ARPA]
[85.100.IN-ADDR.ARPA]
[86.100.IN-ADDR.ARPA]
[87.100.IN-ADDR.ARPA]
[88.100.IN-ADDR.ARPA]
[89.100.IN-ADDR.ARPA]
[90.100.IN-ADDR.ARPA]
[91.100.IN-ADDR.ARPA]
[92.100.IN-ADDR.ARPA]
[93.100.IN-ADDR.ARPA]
[94.100.IN-ADDR.ARPA]
[95.100.IN-ADDR.ARPA]
[96.100.IN-ADDR.ARPA]
[97.100.IN-ADDR.ARPA]
[98.100.IN-ADDR.ARPA]
[99.100.IN-ADDR.ARPA]
[100.100.IN-ADDR.ARPA]
[101.100.IN-ADDR.ARPA]
[102.100.IN-ADDR.ARPA]
[103.100.IN-ADDR.ARPA]
[104.100.IN-ADDR.ARPA]
[105.100.IN-ADDR.ARPA]
[106.100.IN-ADDR.ARPA]
[107.100.IN-ADDR.ARPA]
[108.100.IN-ADDR.ARPA]
[109.100.IN-ADDR.ARPA]
[110.100.IN-ADDR.ARPA]
[111.100.IN-ADDR.ARPA]
[112.100.IN-ADDR.ARPA]
[113.100.IN-ADDR.ARPA]
[114.100.IN-ADDR.ARPA]
[115.100.IN-ADDR.ARPA]
[116.100.IN-ADDR.ARPA]
[117.100.IN-ADDR.ARPA]
[118.100.IN-ADDR.ARPA]
[119.100.IN-ADDR.ARPA]
[120.100.IN-ADDR.ARPA]
[121.100.IN-ADDR.ARPA]
[122.100.IN-ADDR.ARPA]
[123.100.IN-ADDR.ARPA]
[124.100.IN-ADDR.ARPA]
[125.100.IN-ADDR.ARPA]
[126.100.IN-ADDR.ARPA]
[127.100.IN-ADDR.ARPA]
[254.169.IN-ADDR.ARPA]
[2.0.192.IN-ADDR.ARPA]
[100.51.198.IN-ADDR.ARPA]
[113.0.203.IN-ADDR.ARPA]
[255.255.255.255.IN-ADDR.ARPA]
[0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA]
[1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA]
[D.F.IP6.ARPA]
[8.E.F.IP6.ARPA]
[9.E.F.IP6.ARPA]
[A.E.F.IP6.ARPA]
[B.E.F.IP6.ARPA]
[8.B.D.0.1.0.0.2.IP6.ARPA]
[EMPTY.AS112.ARPA]
[HOME.ARPA]
[RESOLVER.ARPA]
[version.bind (view: _bind)]
[hostname.bind (view: _bind)]
[authors.bind (view: _bind)]
[id.server (view: _bind)]
[redfish-solutions.com]
[168.192.in-addr.arpa]
--- Statistics Dump --- (1749414921)
and here is the proc status file:
Name: named
Umask: 0022
State: S (sleeping)
Tgid: 18981
Ngid: 0
Pid: 18981
PPid: 1
TracerPid: 0
Uid: 57 57 57 57
Gid: 57 57 57 57
FDSize: 256
Groups: 57 Kthread: 0
VmPeak: 52756 kB
VmSize: 49212 kB
VmLck: 0 kB
VmPin: 0 kB
VmHWM: 28568 kB
VmRSS: 20560 kB
RssAnon: 16720 kB
RssFile: 3840 kB
RssShmem: 0 kB
VmData: 38704 kB
VmStk: 132 kB
VmExe: 192 kB
VmLib: 5452 kB
VmPTE: 116 kB
VmSwap: 0 kB
CoreDumping: 0
THP_enabled: 0
untag_mask: 0xffffffffffffffff
Threads: 12
SigQ: 0/6847
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000001001000
SigCgt: 0000000000004003
CapInh: 0000000000000000
CapPrm: 0000000001000400
CapEff: 0000000001000400
CapBnd: 000001ffffffffff
CapAmb: 0000000000000000
NoNewPrivs: 0
Seccomp: 0
Seccomp_filters: 0
Speculation_Store_Bypass: thread vulnerable
SpeculationIndirectBranch: always enabled
Cpus_allowed: f
Cpus_allowed_list: 0-3
voluntary_ctxt_switches: 221581
nonvoluntary_ctxt_switches: 10465
More information about the bind-users
mailing list