From ac8366614f5293629332575a2145bbe078ced4cd 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 (cherry picked from commit 0716b0556996ce34b628611274064cbf05fef97c) --- 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 d3416ec03ea0d..5675912f16262 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1123,7 +1123,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: @@ -1144,7 +1146,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