From 0716b0556996ce34b628611274064cbf05fef97c Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Fri, 19 Jun 2020 17:27:58 +0200 Subject: [PATCH] mgr/cephadm: speedup _refresh_hosts_and_daemons by 10x by calling 10 hosts in parallel. Signed-off-by: Sebastian Wagner --- src/pybind/mgr/cephadm/module.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 8bdfe2bdbbc..6e87f4c6f5d 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1118,7 +1118,9 @@ you may want to run: def _refresh_hosts_and_daemons(self): bad_hosts = [] failures = [] - for host in self.cache.get_hosts(): + + @forall_hosts + def refresh(host): if self.cache.host_needs_check(host): r = self._check_host(host) if r is not None: @@ -1139,7 +1141,8 @@ you may want to run: r = self._refresh_host_osdspec_previews(host) if r: failures.append(r) - + + refresh(self.cache.get_hosts()) health_changed = False if 'CEPHADM_HOST_CHECK_FAILED' in self.health_checks: -- 2.39.5