Skip to content

Commit 4caca80

Browse files
committed
issue #627: reduce the default pool size in a child to 2.
Ansible has no blocking services running, or really any service that would have an outsized benefit from multiple IO waiters. Probably we only need 1, but let's start with 2 just in case.
1 parent 5d6e20b commit 4caca80

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

docs/changelog.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ Core Library
222222
to a function call, where the reply might be dropped due to exceeding the
223223
maximum configured message size.
224224

225+
* :gh:issue:`624`: the number of threads used for a child's auto-started thread
226+
pool has been reduced from 16 to 2. This may drop to 1 in future, and become
227+
configurable via a :class:`Router` option.
228+
225229
* :gh:commit:`a5536c35`: avoid quadratic
226230
buffer management when logging lines received from a child's redirected
227231
standard IO.

mitogen/service.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def all(it):
5555

5656
LOG = logging.getLogger(__name__)
5757

58-
DEFAULT_POOL_SIZE = 16
5958
_pool = None
6059
_pool_pid = None
6160
#: Serialize pool construction.
@@ -88,7 +87,7 @@ def get_or_create_pool(size=None, router=None):
8887
_pool = Pool(
8988
router,
9089
services=[],
91-
size=size or DEFAULT_POOL_SIZE,
90+
size=size or 2,
9291
overwrite=True,
9392
recv=mitogen.core.Dispatcher._service_recv,
9493
)

0 commit comments

Comments
 (0)