Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.x] Flux Engine -- Query Controls #17212

Closed
timhallinflux opened this issue Mar 11, 2020 · 4 comments
Closed

[1.x] Flux Engine -- Query Controls #17212

timhallinflux opened this issue Mar 11, 2020 · 4 comments

Comments

@timhallinflux
Copy link
Contributor

With InfluxQL, we introduced a number of mechanisms to control queries over the course of the 1.x releases. These are documented here: https://docs.influxdata.com/influxdb/v1.7/troubleshooting/query_management

With the introduction of Flux into the 1.x release line as a parallel query engine, the question is whether similar controls need to exist for Flux.

It seems that the Flux engine can limit resource usage in a number of ways such as:

  • Max Compute count - the number of go-routines allowed to service the query
  • Max RAM - a counter of the memory a query is using, if the query goes over this limit the query is canceled. There are some soft/hard limits that can be leveraged as well.
  • Concurrent query limits - Limit the number of concurrent queries.

Proposal:
The request is to determine the appropriate interface and controls to expose to limit resource exhaustion by the Flux engine. Providing sufficient guardrails for InfluxDB admins to put in place which are similar in principle to the ones that exist for the InfluxQL engine.

It may be that the end user doesn't necessarily know why their query exhausted resources, but we should be able to log queries which exceed the defined limits. This allows for admins to review expensive queries with their users and potentially communicate them as issues for review (and optimization).

@timhallinflux
Copy link
Contributor Author

These are in OSS 2.x -- need config options for setting these in 1.x

query-concurrency
query-initial-memory-bytes
query-max-memory-bytes
query-memory-bytes
query-queue-size

@lesam lesam self-assigned this Mar 25, 2021
lesam added a commit to lesam/influxdb that referenced this issue Mar 30, 2021
lesam added a commit to lesam/influxdb that referenced this issue Mar 30, 2021
lesam added a commit to lesam/influxdb that referenced this issue Mar 30, 2021
lesam added a commit that referenced this issue Mar 30, 2021
* chore: pull in controller from 2.x

* chore: fix up 2.x controller to work with 1.x

* feat: Default query limits in flux code

Partial fix of #17212

* chore: update changelog

* chore: refactor to remove panic and reformat code
@lesam
Copy link
Contributor

lesam commented Mar 30, 2021

Here's the new stanza in the config:

[flux-controller]
  query-concurrency = 0
  query-initial-memory-bytes = 0
  query-max-memory-bytes = 0
  total-max-memory-bytes = 0
  query-queue-size = 0

@lesam
Copy link
Contributor

lesam commented Mar 30, 2021

Note that zeros mean unlimited - this is new behaviour in 1.x, in 2.x some of the limits are required and default pretty low.

@lesam
Copy link
Contributor

lesam commented Apr 6, 2021

Closed in PR 21108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants