Skip to content
Snippets Groups Projects
Commit f4fffb84 authored by Martin Blanchard's avatar Martin Blanchard
Browse files

Allow manually tuning the max. number of threads

parent a9c8ae2d
No related branches found
No related tags found
No related merge requests found
......@@ -119,6 +119,14 @@ def _create_server_from_config(configuration):
click.echo("Error: Configuration, {}.".format(e), err=True)
sys.exit(-1)
if 'thread-pool-size' in configuration:
try:
kargs['max_workers'] = int(configuration['thread-pool-size'])
except ValueError as e:
click.echo("Error: Configuration, {}.".format(e), err=True)
sys.exit(-1)
server = BuildGridServer(**kargs)
try:
......
......@@ -136,3 +136,7 @@ monitoring:
# binary - Protobuf binary format.
# json - JSON format.
serialization-format: binary
##
# Maximum number of gRPC threads.
thread-pool-size: 20
......@@ -91,6 +91,8 @@ class BuildGridServer:
self.__grpc_server = grpc.server(self.__grpc_executor,
options=(('grpc.so_reuseport', 0),))
self.__logger.debug("Setting up gRPC server with thread-limit=[%s]", max_workers)
self.__main_loop = asyncio.get_event_loop()
self.__monitoring_bus = None
......
......@@ -38,3 +38,5 @@ instances:
- !execution
storage: *data-store
action-cache: *build-cache
thread-pool-size: 200
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment