Collecting slow Solr queries 

The solr_slow_sub_query_log retains query information of long-running CQL statements to help you identify slow queries on a cluster so that you can tune poorly performing queries. Enable the solr_slow_sub_query_log_options parameter in dse.yaml.

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

The location of the dse.yaml file depends on the type of installation:
Installer-Services /etc/dse/dse.yaml
Package installations /etc/dse/dse.yaml
Installer-No Services install_location/resources/dse/conf/dse.yaml
Tarball installations install_location/resources/dse/conf/dse.yaml

Procedure

  1. To permanently enable collecting information on slow Solr 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: 3000
    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 enable collecting information on slow Solr queries that exceed the specified threshold:
    $ dsetool perf solrslowlog disable
  3. You can export slow Solr queries using the CQL copy command:
    cqlsh:dse_perf> COPY solr_slow_sub_query_log ( date, commands, duration ) TO 'slow_solr_queries.csv' WITH HEADER = true;