Reduce to 1 thread the processing of `IpConntrackManager` events

The multithread processing does not add any speed improvement to the
event processing. The aim of this patch is to reduce to 1 the number of
threads processing the ``IpConntrackManager`` events.

Closes-Bug: #2073745
Change-Id: I190d842349a86868578d6b6ee2ff53cfcd6fb1cc
This commit is contained in:
Rodolfo Alonso Hernandez
2024-07-19 18:25:39 +00:00
parent 045530814f
commit 23b9077df5

View File

@@ -27,8 +27,6 @@ CONTRACK_MGRS = {}
MAX_CONNTRACK_ZONES = 65535
ZONE_START = 4097
WORKERS = 8
class IpConntrackUpdate(object):
"""Encapsulates a conntrack update
@@ -74,13 +72,8 @@ class IpConntrackManager(object):
self.zone_per_port = zone_per_port # zone per port vs per network
self._populate_initial_zone_map()
self._queue = eventlet.queue.LightQueue()
self._start_process_queue()
def _start_process_queue(self):
LOG.debug("Starting ip_conntrack _process_queue_worker() threads")
pool = eventlet.GreenPool(size=WORKERS)
for i in range(WORKERS):
pool.spawn_n(self._process_queue_worker)
LOG.debug('Starting the ip_conntrack _process_queue_worker() thread')
eventlet.spawn_n(self._process_queue_worker)
def _process_queue_worker(self):
# While it's technically not necessary to have this method, the