Collecting slow search queries
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.
Where is the dse.yaml file?
The location of the dse.yaml file depends on the type of installation:
| Installation Type | Location |
|---|---|
Package installations + Installer-Services installations |
|
Tarball installations + Installer-No Services installations |
|
Procedure
To identify slow search queries using the DataStax Enterprise Performance Service:
-
To permanently enable and configure collecting information on slow search queries, edit the
dse.yamlfile and uncomment thesolr_slow_sub_query_log_optionsparameters, 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: 100The default parameter values minimize resource usage.
Default parameter values options Options Determines enabled
Whether the object is enabled at start up.
ttl_secondsHow many seconds a record survives before it is expired from the performance object.
async_writersFor event-driven objects, such as the slow log, determines the number of possible concurrent slow query recordings. Objects like
solr_result_cache_statsare updated in the background.threshold_msFor the slow log, the level (in milliseconds) at which a sub-query slow enough to be reported.
-
To temporarily change the running parameters for collecting information on slow Solr queries:
To temporarily enable collecting information:
dsetool perf solrslowlog enableTo temporarily disable collecting information:
dsetool perf solrslowlog disableTo temporarily change the threshold value in milliseconds:
dsetool perf solrslowlog 200 -
You can export slow search queries using the CQL
copycommand:cqlsh:dse_perf> COPY solr_slow_sub_query_log ( date, commands, duration ) TO 'slow_solr_queries.csv' WITH HEADER = true;