2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

Update BIND 9 Memory Explained: updated memory-json to work with xq output

Petr Špaček 2023-09-14 14:02:46 +00:00
parent bbf111c12f
commit e7508fbdb1

@ -29,8 +29,17 @@ Measuring real memory usage can be tricky, but fortunately, there are some tools
The [statistics channel](https://bind9.readthedocs.io/en/latest/reference.html#namedconf-statement-statistics-channels) exposes counters for the memory contexts. The important values are 'InUse' and 'Malloced'. The 'InUse' counter shows the memory used "externally" and 'Malloced' includes the management overhead (the more memory contexts the more overhead there is).
You can use attached [memory-json.py](uploads/e9398e64964bbd68e7715c594dadbd3e/memory-json.py) script to parse the statistics channel output from URL `/json/v1` to obtain following summary data (this is from `main` branch):
You can use attached [memory-json.py](uploads/d907c0f06b7d36469443019920bf4b05/memory-json.py) script to parse the statistics channel output from URL `/json/v1`.
In case BIND was compiled only with XML output support, take statistics from URL `/xml/v3` and convert it to JSON using [xq command](https://kislyuk.github.io/yq/#xml-support):
```
xq < stats.xml > stats.json
```
Finally, the script above outputs summary data (this is from `main` branch):
```
./memory-json.py stats.json
```
```
OpenSSL: 268.8KiB 277.0KiB
uv: 6.1KiB 14.3KiB