Limiting queries by time
DSE Search supports limiting queries by time.
- If the timeAllowed is exceeded, an exception is thrown.
- If the timeAllowed is exceeded, and the additional shards.tolerant parameter is set to
true, the application returns the partial results collected so far.
When partial results are returned, the CQL custom payload contains the
DSESearch.isPartialResults
key.
SELECT * FROM users where solr_query = '{ "q": "*:*", "timeAllowed":30000}';
timeAllowed
parameter is enabled by default to prevent long running
shard queries, such as complex facets and Boolean queries, from using system resources after they
have timed out from the DSE Search coordinator. solr.timeAllowed.docsPerSample
has been removed.By default for all queries, the value for timeAllowed
is the same as the
internode_messaging_options.client_request_timeout_seconds
parameter in dse.yaml
. Queries that breach
client_request_timeout_seconds
fail by default.
The 50th percentile latency for queries using timeAllowed
should be
within 5% of the same query that does not use timeAllowed
.
The timeAllowed
parameter applies to these queries:
- Standard queries and filtering queries, where the timeout is applied on a match collection.
- Facet queries, including pivot facets.
The json.facet
queries are not supported.
Queries that are terminated due to a timeout are logged with a warning.
timeAllowed
parameter may cause a latency cost. If you find
the cost for queries is too high in your environment, consider setting the
-Ddse.timeAllowed.enabled.default
property to
false
at DSE startup time. Or set
timeAllowed.enable
to false in the query.