Limiting queries by time
DSE Search supports limiting queries by time by using the Solr timeAllowed
parameter.
DSE Search differs from native Solr:
-
If the
timeAllowed
is exceeded, an exception is thrown. -
If the
timeAllowed
is exceeded, and the additionalshards.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.
Example with a 30 second timeout:
SELECT * FROM users where solr_query = '{ "q": "*:*", "timeAllowed":30000}';
The Solr 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.
DSE Search checks the timeout per segment instead of during document or terms iteration.
The system property |
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.
Using the Solr |