Collecting slow search queries

Thesolr_slow_sub_query_log_options performance object reports distributed sub-queries (query executions on individual shards) that take longer than a specified period of time.

All objects are disabled by default.

Procedure

To identify slow search queries using the DataStax Enterprise Performance Service:

  1. To permanently enable and configure collecting information on slow search queries, edit the dse.yaml file and uncomment the solr_slow_sub_query_log_options parameters, and define values for the CQL slow log settings:

    solr_slow_sub_query_log_options:
        enabled:true
        ttl_seconds: 604800
        async_writers: 1
        threshold_ms: 100

    The default parameter values minimize resource usage.

    Options Determines

    enabled

    Whether the object is enabled at start up.

    ttl_seconds

    How many seconds a record survives before it is expired from the performance object.

    async_writers

    For event-driven objects, such as the slow log, determines the number of possible concurrent slow query recordings. Objects like solr_result_cache_stats are updated in the background.

    threshold_ms

    For the slow log, the level (in milliseconds) at which a sub-query slow enough to be reported.

  2. To temporarily change the running parameters for collecting information on slow Solr queries:

    To temporarily enable collecting information:

    dsetool perf solrslowlog enable

    To temporarily disable collecting information:

    dsetool perf solrslowlog disable

    To temporarily change the threshold value in milliseconds:

    dsetool perf solrslowlog 200
  3. You can export slow search queries using the CQL COPY TO command:

    cqlsh:dse_perf> COPY solr_slow_sub_query_log ( date, commands, duration ) TO 'slow_solr_queries.csv' WITH HEADER = true;

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