From 142688cefc420180cca4137a7441f817cbbe1486 Mon Sep 17 00:00:00 2001 From: Kaituo Li Date: Fri, 19 Jun 2020 17:11:17 -0700 Subject: [PATCH 1/2] Rollover AD result index less frequently MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, we roll over the result index every 30 days or every 300000 docs. Assuming each doc has 1 KB and our result index has five shards, each shard takes about 60 MB, which is too small. Small shards are against ES best practice. This PR increases the rollover threshold to 9000000 docs, which increases the max shard size to roughly 1.8 GB.  --- .../ad/settings/AnomalyDetectorSettings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/amazon/opendistroforelasticsearch/ad/settings/AnomalyDetectorSettings.java b/src/main/java/com/amazon/opendistroforelasticsearch/ad/settings/AnomalyDetectorSettings.java index 5b5b267b..c507214e 100644 --- a/src/main/java/com/amazon/opendistroforelasticsearch/ad/settings/AnomalyDetectorSettings.java +++ b/src/main/java/com/amazon/opendistroforelasticsearch/ad/settings/AnomalyDetectorSettings.java @@ -88,7 +88,7 @@ private AnomalyDetectorSettings() {} // Suppose generally per cluster has 200 detectors and all run with 1 minute interval. // We will get 288,000 AD result docs. So set it as 300k to avoid multiple roll overs // per day. - 300 * 1000L, + 9_000_000L, 0L, Setting.Property.NodeScope, Setting.Property.Dynamic From ac3bc59701689e8dd1074d3ff130bfb7a94f90d2 Mon Sep 17 00:00:00 2001 From: Kaituo Li Date: Mon, 22 Jun 2020 10:49:52 -0700 Subject: [PATCH 2/2] Update comments --- .../ad/settings/AnomalyDetectorSettings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/amazon/opendistroforelasticsearch/ad/settings/AnomalyDetectorSettings.java b/src/main/java/com/amazon/opendistroforelasticsearch/ad/settings/AnomalyDetectorSettings.java index c507214e..708d8045 100644 --- a/src/main/java/com/amazon/opendistroforelasticsearch/ad/settings/AnomalyDetectorSettings.java +++ b/src/main/java/com/amazon/opendistroforelasticsearch/ad/settings/AnomalyDetectorSettings.java @@ -86,7 +86,7 @@ private AnomalyDetectorSettings() {} .longSetting( "opendistro.anomaly_detection.ad_result_history_max_docs", // Suppose generally per cluster has 200 detectors and all run with 1 minute interval. - // We will get 288,000 AD result docs. So set it as 300k to avoid multiple roll overs + // We will get 288,000 AD result docs. So set it as 9000k to avoid multiple roll overs // per day. 9_000_000L, 0L,