From e24b23bc5118092b1392cbaa6fb4c518c1aa8d3a Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Mon, 10 Feb 2014 16:25:24 -0800 Subject: [PATCH] Run fewer es queries with elastic_recheck. Currently elastic-recheck is hammering the ElasticSearch cluster every 15 minutes, basically bringing everything else to a halt while these queries are processed. Spread elastic-recheck periodic queries out, run each once an hour and 20 minutes after the previous set of queries. Also, remove the auto triggering when files change, instead we wait for the hour to roll over and give us new data. Change-Id: Ibf5dad1071f65f8d676e8b9a0ec4331bada9943f --- modules/elastic_recheck/manifests/cron.pp | 8 +++--- modules/elastic_recheck/manifests/init.pp | 30 ----------------------- 2 files changed, 4 insertions(+), 34 deletions(-) diff --git a/modules/elastic_recheck/manifests/cron.pp b/modules/elastic_recheck/manifests/cron.pp index 137d5015d2..3d401a727d 100644 --- a/modules/elastic_recheck/manifests/cron.pp +++ b/modules/elastic_recheck/manifests/cron.pp @@ -25,7 +25,7 @@ class elastic_recheck::cron () { cron { 'elastic-recheck-all': user => 'recheck', - minute => '*/15', + minute => '0', hour => '*', command => "cd ${er_state_path} && er_safe_run.sh ${graph_all_cmd}", environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', @@ -34,9 +34,9 @@ class elastic_recheck::cron () { cron { 'elastic-recheck-gate': user => 'recheck', - minute => '*/15', + minute => '20', hour => '*', - command => "sleep $((RANDOM\%60+90)) && cd ${er_state_path} && er_safe_run.sh ${graph_gate_cmd}", + command => "cd ${er_state_path} && er_safe_run.sh ${graph_gate_cmd}", environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', require => Class['elastic_recheck'] } @@ -44,7 +44,7 @@ class elastic_recheck::cron () { cron { 'elastic-recheck-uncat': user => 'recheck', - minute => '59', + minute => '40', hour => '*', command => "cd ${er_state_path} && er_safe_run.sh ${uncat_cmd}", environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', diff --git a/modules/elastic_recheck/manifests/init.pp b/modules/elastic_recheck/manifests/init.pp index b17533147f..4cdc47b0ba 100644 --- a/modules/elastic_recheck/manifests/init.pp +++ b/modules/elastic_recheck/manifests/init.pp @@ -46,36 +46,6 @@ class elastic_recheck ( source => 'https://git.openstack.org/openstack-infra/elastic-recheck', } - exec { 'run_er_graph_all': - command => "er_safe_run.sh ${graph_all_cmd}", - path => '/usr/local/bin:/usr/bin:/bin/', - cwd => $recheck_state_dir, - user => 'recheck', - refreshonly => true, - require => File['/usr/local/bin/er_safe_run.sh'], - subscribe => Vcsrepo['/opt/elastic-recheck'], - } - - exec { 'run_er_graph_gate_only': - command => "er_safe_run.sh ${graph_gate_cmd}", - path => '/usr/local/bin:/usr/bin:/bin/', - cwd => $recheck_state_dir, - user => 'recheck', - refreshonly => true, - require => File['/usr/local/bin/er_safe_run.sh'], - subscribe => Vcsrepo['/opt/elastic-recheck'], - } - - exec { 'run_er_uncat': - command => "er_safe_run.sh ${uncat_cmd}", - path => '/usr/local/bin:/usr/bin:/bin/', - cwd => $recheck_state_dir, - user => 'recheck', - refreshonly => true, - require => File['/usr/local/bin/er_safe_run.sh'], - subscribe => Vcsrepo['/opt/elastic-recheck'], - } - include pip exec { 'install_elastic-recheck' : command => 'pip install /opt/elastic-recheck',