influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

Proposal: Protect influxdb from excessive queries

Open mintyc opened this issue 10 years ago • 2 comments

The problems noted regarding excessive queries are all too real particularly with tools like grafana allowing users to create in service new queries.

Blog post http://tech.trivago.com/2016/02/23/protector/

And github https://github.com/trivago/Protector

Very grateful they have provided a middleman tool to police this but it probably has limitations as an external tool.

These inspired me to request that the new query engine looks to provide built in support for some of the protection mechanisms mentioned.

Perhaps have a 'protect' keyword for queries that applies additional safeguards. Could also be applied to certain types of user by default?

Query monitoring: if a query takes longer than some threshold time, record the query in a slow query log.

Query protection (optionally enabled) a) Another threshold to abandon a query after that timeout.

b) If a request is going to result in a large number of datapoints [configurable limit], if a 'protected' variant of the query cancel it.

The middleman approach would always be difficult to get right. Eg suddenly queries will be much faster in 0.11 we hope so rules that estimate rather than measure query times would be more fragile.

mintyc avatar Feb 25 '16 18:02 mintyc

+1. In reality users will do stupid queries and the system needs to protect them. While the new query engine prevents them OOMíng, you could potentially kick off a query that reads in every piece of data and slows everything down. Manually killing those queries isnt really viable.

daviesalex avatar Mar 02 '16 01:03 daviesalex

#6024 will be covering query limits to protect the server from certain types of queries. I'm going to close this as a duplicate since we're tracking this progress in the other issue.

Please reopen if I've misunderstood something and closed this in error. Thanks!

jsternberg avatar Mar 28 '16 16:03 jsternberg