Right now, interactive queries (those run as a direct result of an http request) have an execution limit of 300 seconds- this is implemented with an event server side. However, despite having a max_connection limit of 10000 connections (those are connections allowed- the maximum concurrency is 64 threads), even 30 second to 1 minute queries (T160914) can overload the server if done fast enough. This afects only interactive queries- either http brower requests or api queries, not terbium, maintenance, dumps, vslow or other queries.
Max execution limit is a protection, but it kills legitimate queries to avoid overload, so it is not something to do freely.
Some things that can be done:
- Reduce interactive execution time to 1 minute or 30 seconds
- Reduce interactive execution time inversely proportional to the number of connected threads
- Implement matching patterns, like killing queries that are long (>1 second) and similar in pattern - e.g. same digest (needs complex implementation)
- Increase the maximum number of concurrent threads (can bring down the server if done incorrectly, and above 64 threads, the throughput is not really better)