nodepool/nodepool/driver/fake
Tobias Henkel 2e59f7b0b3
Offload waiting for server creation/deletion
Currently nodepool has one thread per server creation or
deletion. Each of those waits for the cloud by regularly getting the
server list and checking if their instance is active or gone. On a
busy nodepool this leads to severe thread contention when the server
list gets large and/or there are many parallel creations/deletions in
progress.

This can be improved by offloading the waiting to a single thread that
regularly retrieves the server list and compares that to the list of
waiting server creates/deletes. The calling threads are then waiting
until the central thread wakes them up to proceed their task. The
waiting threads are waiting for the event outside of the GIL and thus
are not contributing to the thread contention problem anymore.

An alternative approach would be to redesign the threading to be less
threaded but this would be a much more complex redesign. Thus this
change keeps the many threads approach but makes them wait much more
lightweight which shows a substantial improvement during load testing
in a test environment.

Change-Id: I5525f2558a4f08a455f72e6b5479f27684471dc7
2021-02-16 15:37:57 +01:00
..
__init__.py Remove unused use_taskmanager flag 2019-04-02 12:11:07 +00:00
config.py Refactor provider config to driver module 2017-11-29 05:22:12 +00:00
handler.py Add launcher ID to log messages 2017-10-04 07:22:39 -04:00
provider.py Offload waiting for server creation/deletion 2021-02-16 15:37:57 +01:00