From 2e99f855387448211cbc1aec3b531a7c6487928d Mon Sep 17 00:00:00 2001 From: Roman Krček Date: Fri, 14 Feb 2025 14:26:26 +0000 Subject: Fix kolla_container_facts performance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a container has been running for some time, it will accumulate MBs worth of healthcheck logs that kolla_container_facts module will forward to ansible when action "get_container" is called. That causes the execution of this module to slow down considerably. Change-Id: I6b11672ba093c65cef4d20f8ef716e459c2a92c3 Signed-off-by: Roman Krček --- ansible/library/kolla_container_facts.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ansible/library') diff --git a/ansible/library/kolla_container_facts.py b/ansible/library/kolla_container_facts.py index fcd2afb59..041aa3904 100644 --- a/ansible/library/kolla_container_facts.py +++ b/ansible/library/kolla_container_facts.py @@ -120,6 +120,9 @@ class ContainerFactsWorker(): container_name = container.name if names and container_name not in names: continue + # NOTE(r-krcek): For performance reasons don't include + # healthcheck logs. It can contain MBs worth of data! + container.attrs["State"].get("Health", dict()).pop("Log", None) self.result['containers'][container_name] = container.attrs def get_containers_state(self): -- cgit v1.2.3