yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #94241
[Bug 2070376] Re: [eventlet-deprecation] Reduce the DHCP agent pool processing to a single thread
Reviewed: https://review.opendev.org/c/openstack/neutron/+/923626
Committed: https://opendev.org/openstack/neutron/commit/6d480cbaf51cf943ded0114e9cc0eca3bb7525fa
Submitter: "Zuul (22348)"
Branch: master
commit 6d480cbaf51cf943ded0114e9cc0eca3bb7525fa
Author: Rodolfo Alonso Hernandez <ralonsoh@xxxxxxxxxx>
Date: Mon Jul 8 09:35:55 2024 +0000
[DHCP] Reduce to one single thread the event processing
The RPC events received by the client are stored in a queue and
processed depending on a priority. Before this patch, a pool of
threads was spawned to process the received events. However, this
model does not improve the processing speed and could lead to potential
thread concurrencies not considered. Note that the event processing
methods are thread safe against the sync method but not among them.
This patch reduce the number of concurrent threads processing the
received events to one only, that is safe against the sync process.
The network sync process could happen when:
* ``_dhcp_ready_ports_loop`` is called.
* ``sync_state`` is called.
Closes-Bug: #2070376
Change-Id: I21d237de97571aaaae3912d060a3e03a37dd20de
** Changed in: neutron
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/2070376
Title:
[eventlet-deprecation] Reduce the DHCP agent pool processing to a
single thread
Status in neutron:
Fix Released
Bug description:
The improvement done in [1] helps to process the RPC events, assigning
a priority to these events and optimizing the dispatch strategy.
However the multithreading processing of these events introduced in
this patch does not add any performance improvement. The DHCP agent is
a single process service and due to the nature of CPython, there is no
real multithreading during the execution of Python code.
We are now currently using green threads (``eventlet.GreenPool``) to spawn the resource update method (the method that reads the ordered list of events and performs the needed action in the DHCP driver). Any action is stored in a priority queue and the first available resource update thread will process it. However this implementation has several drawbacks:
* It doesn't provide any performance improvement. Having multiple threads running Python code doesn't outperform a single thread process.
* If we switch from collaborative threads (green threads) to pre-emptive threads (kernel threads), we must implement locking blocks for the resource update methods, that will also result in more restricted thread executions.
This bug proposes to remove the resource update threading and leave a
single thread that will read the event queue and perform the needed
actions.
[1]https://review.opendev.org/c/openstack/neutron/+/626830
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/2070376/+subscriptions
References