diff --git a/doc/newsfragments/3060_changed.pool_size.rst b/doc/newsfragments/3060_changed.pool_size.rst new file mode 100755 index 000000000..3fda2d2db --- /dev/null +++ b/doc/newsfragments/3060_changed.pool_size.rst @@ -0,0 +1 @@ +Increase the number of Remote worker setup thread. \ No newline at end of file diff --git a/testplan/runners/pools/remote.py b/testplan/runners/pools/remote.py index f31cf5653..c492ac12d 100644 --- a/testplan/runners/pools/remote.py +++ b/testplan/runners/pools/remote.py @@ -3,6 +3,7 @@ import os import signal import socket +from multiprocessing import cpu_count from multiprocessing.pool import ThreadPool from typing import Callable, Dict, List, Optional, Tuple, Type, Union @@ -378,7 +379,7 @@ def _start_thread_pool(self) -> None: size = len(self._instances) try: if size > 2: - self.pool = ThreadPool(5 if size > 5 else size) + self.pool = ThreadPool(min(size, cpu_count())) except Exception as exc: if isinstance(exc, AttributeError): self.logger.warning(