You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2018/02/07 22:46:02 UTC

lucene-solr:master: Add documentation for searchRate trigger.

Repository: lucene-solr
Updated Branches:
  refs/heads/master 466c1ef4d -> d2e8e1023


Add documentation for searchRate trigger.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/d2e8e102
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/d2e8e102
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/d2e8e102

Branch: refs/heads/master
Commit: d2e8e10233b4e2d25a10b12cbc9e916bc52300f1
Parents: 466c1ef
Author: Andrzej Bialecki <ab...@apache.org>
Authored: Wed Feb 7 14:43:50 2018 -0800
Committer: Andrzej Bialecki <ab...@apache.org>
Committed: Wed Feb 7 14:45:55 2018 -0800

----------------------------------------------------------------------
 .../src/solrcloud-autoscaling-triggers.adoc     | 51 ++++++++++++++++++++
 1 file changed, 51 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d2e8e102/solr/solr-ref-guide/src/solrcloud-autoscaling-triggers.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/solrcloud-autoscaling-triggers.adoc b/solr/solr-ref-guide/src/solrcloud-autoscaling-triggers.adoc
index 5a98657..a7a8d52 100644
--- a/solr/solr-ref-guide/src/solrcloud-autoscaling-triggers.adoc
+++ b/solr/solr-ref-guide/src/solrcloud-autoscaling-triggers.adoc
@@ -35,6 +35,7 @@ Currently the following event types (and corresponding trigger implementations)
 * `nodeAdded` - generated when a new node joins the cluster
 * `nodeLost` - generated when a node leaves the cluster
 * `metric` - generated when the configured metric crosses a configured lower or upper threshold value
+* `searchRate` - generated when the 1 min average search rate exceeds configured upper threshold
 
 Events are not necessarily generated immediately after the corresponding state change occurred - the
 maximum rate of events is controlled by the `waitFor` configuration parameter (see below).
@@ -87,6 +88,56 @@ This trigger supports the following configuration:
 }
 ----
 
+== Search Rate trigger
+
+The search rate trigger can be used for monitoring 1-min average search rates in a selected
+collection, and request that either replicas be moved to different nodes or new replicas be added
+to reduce the per-replica search rate for a collection / shard with search rate hot spots.
+(Note: future versions of Solr will also be able to automatically remove some replicas
+when search rate falls below the configured lower threshold).
+
+This trigger support the following configuration:
+
+* `collection` - (string, optional) collection name to monitor, or any collection if empty
+* `shard` - (string, optional) shard name within the collection (requires `collection` to be set), or any shard if empty
+* `node` - (string, optional) node name to monitor, or any if empty
+* `handler` - (string, optional) handler name whose request rate represents the search rate
+(default is `/select`). This name is used for creating the full metric key, in
+this case `solr.core.<coreName>:QUERY./select.requestTimes:1minRate`
+* `rate` - (double, required) the upper bound for the request rate metric value.
+
+If a rate is exceeded for a node (but not for individual replicas placed on this node) then
+the action requested by this event is to move one replica (with the highest rate) to another
+node. If a rate is exceeded for a collection / shard then the action requested is to add some
+replicas - currently at least 1 and at most 3, depending on how much the rate is exceeded, proportional to
+the threshold rate and the current request rate.
+
+.Example: a trigger configuration that monitors collection "test" and adds new replicas if 1-min average request rate of "/select" handler exceeds 100 reqs/sec:
+[source,json]
+----
+{
+ "set-trigger": {
+  "name" : "search_rate_trigger",
+  "event" : "searchRate",
+  "collection" : "test",
+  "handler" : "/select",
+  "rate" : 100.0,
+  "waitFor" : "1m",
+  "enabled" : true,
+  "actions" : [
+   {
+    "name" : "compute_plan",
+    "class": "solr.ComputePlanAction"
+   },
+   {
+    "name" : "execute_plan",
+    "class": "solr.ExecutePlanAction"
+   }
+  ]
+ }
+}
+----
+
 == Trigger Configuration
 Trigger configurations are managed using the Autoscaling Write API and the commands `set-trigger`, `remove-trigger`,
 `suspend-trigger`, and `resume-trigger`.