Given that both
query-memory-bytes are available options for InfluxDB v2, I assume the first option specifies how much data is initially allocated for a given query, but more can be allocated if needed, up to a maximum of
query-memory-bytes. Config option docs are here. In practice, my influxdb instance is killing queries which attempt to use more than
query-initial-memory-bytes, even though
query-memory-bytes is much higher. Am I misunderstanding the config options or does this sound like a bug? For what it’s worth, I’m running InfluxDB version 2.7 in a Docker container.
I’m interested in these options because I’d like to have both a limit on individual query memory (about 2 gigs seems appropriate for my setup) and a limit on the memory used by all queries concurrently (3 gigs). Given that I want to set
query-concurrency to 20,
query-initial-memory-bytes needs to be pretty low in order to have that 3 gig total limit.
Given that both
You can view the config options here:
You are correct:
Maximum bytes of memory allowed for a single query.
Maximum total bytes of memory allowed for queries.
Yes I think it’ll kill a query that’s using more than the max/per query. I’m not sure which queries are stopped if the sum of memory use for multiple simultaneous queries exceeds the total max (im assuming the last ones to run that exceed the limit). I don’t think it’s a bug. I think people run tasks that execute queries on a schedule.
Thanks for the clarification @Anaisdg . Something about my testing gave me the impression my queries were being cut off at
query-initial-memory-bytes but that isn’t happening now so I guess it’s fine.