https://questdb.io logo
Title
h

Hasitha Dharmasiri

12/21/2022, 6:50 PM
apology in advance if this is documented somewhere we haven't found or answered already - we've been looking at memory for capacity planning and have a Helm-deployed 8GB-limited QuestDB instance running on one of our k8s clusters. we recently began scraping metrics off of it. I'm trying to get to the bottom of the
questdb_memory_mem_used
metric, which occasionally sees excursions way beyond the resource limits. does anyone have a good handle on what contributes to this metric and what we could be seeing?
for reference the
NATIVE_*
tagged metrics seem much more sane in the same time period:
a

Andrey Pechkurov

12/21/2022, 6:55 PM
Hi Hasitha, We have the list of Prometheus metrics documented here: https://questdb.io/docs/third-party-tools/prometheus
questdb_memory_mem_used
includes all native memory allocations which may include virtual memory if it wasn't touched yet.
This metric includes mmapped files, so that's why its value is that big.
h

Hasitha Dharmasiri

12/21/2022, 6:56 PM
hm, I guess I'd expect the sum of everything tagged NATIVE to equal it
ah got it
that would do it, so accessing the larger tables would blow up the number I assume
a

Andrey Pechkurov

12/21/2022, 6:58 PM
Yup, that's right. However, mmapped memory is elastic and mostly virtual. Only free memory is used for the page cache, so it's fine if this metric has a large value.
m

Miguel Arregui

12/21/2022, 6:58 PM
distinct and join queries would make use of this metric
h

Hasitha Dharmasiri

12/21/2022, 7:02 PM
yup! thanks for the clarification
j

javier ramirez

12/22/2022, 8:26 AM
Hashitha, I find your question (and the replies by Andrei and Miguel) very relevant and it could help other users. Do you mind if I post it as a Q&A on the StackOverflow #questdb tag ?