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 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.

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 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.

Using the Solr 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.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com