One of things we watch while updating non-TSDB period configs to TSDB
period configs is the difference in query parallelism. TSDB dynamically
shards queries into (potentially) much smaller units of work compared to
the static shard factors uses prior. To account for this, we use much
higher query parallelism configurations with TSDB period configs.
This creates a potential problem when querying across `non-tsdb, tsdb`
period boundaries: we may want a query parallelism of 512 for the tsdb
portion but only 64 for the non-tsdb portion! However, we only had one
limit to specify this per tenant, meaning this would be too high when
querying non-tsdb periods or too low when querying tsdb ones.
This PR
* Introduces `tsdb_max_query_parallelism` (default `512`) to
`limits_config`
* Uses `tsdb_max_query_parallelism` and `max_query_parallelism` limits
to find a better parallelism _per query_ by weighting the two respective
configs by the proportion of each query spent on TSDB or non-TSDB period
configurations.
Signed-off-by: Owen Diehl <ow.diehl@gmail.com>
f.Var(&l.MaxQueryLookback,"querier.max-query-lookback","Limit how long back data (series and metadata) can be queried, up until <lookback> duration ago. This limit is enforced in the query-frontend, querier and ruler. If the requested time range is outside the allowed range, the request will not fail but will be manipulated to only query data within the allowed time range. 0 to disable.")
f.IntVar(&l.MaxQueryParallelism,"querier.max-query-parallelism",32,"Maximum number of queries will be scheduled in parallel by the frontend.")
f.IntVar(&l.TSDBMaxQueryParallelism,"querier.tsdb-max-query-parallelism",512,"Maximum number of queries will be scheduled in parallel by the frontend for TSDB schemas.")
f.IntVar(&l.CardinalityLimit,"store.cardinality-limit",1e5,"Cardinality limit for index queries.")
f.IntVar(&l.MaxStreamsMatchersPerQuery,"querier.max-streams-matcher-per-query",1000,"Limit the number of streams matchers per query")
f.IntVar(&l.MaxConcurrentTailRequests,"querier.max-concurrent-tail-requests",10,"Limit the number of concurrent tail requests")
@ -423,6 +425,12 @@ func (o *Overrides) QueryReadyIndexNumDays(userID string) int {