@@ -992,7 +992,9 @@ def start_server(config_directory: str, workspace_directory: str,
992992 package_data , port : int , config_sql_server ,
993993 listen_address : str , force_auth : bool ,
994994 skip_db_cleanup : bool , context , check_env ,
995- machine_id : str ) -> int :
995+ machine_id : str ,
996+ api_handler_processes : Optional [int ],
997+ task_worker_processes : Optional [int ]) -> int :
996998 """
997999 Starts the HTTP server to handle Web client and Thrift requests, execute
9981000 background jobs.
@@ -1036,7 +1038,9 @@ def start_server(config_directory: str, workspace_directory: str,
10361038 manager = session_manager .SessionManager (
10371039 server_cfg_file ,
10381040 server_secrets_file ,
1039- force_auth )
1041+ force_auth ,
1042+ api_handler_processes ,
1043+ task_worker_processes )
10401044
10411045 except IOError as ioerr :
10421046 LOG .debug (ioerr )
@@ -1067,8 +1071,7 @@ def start_server(config_directory: str, workspace_directory: str,
10671071
10681072 bg_processes : Dict [int , Process ] = {}
10691073 requested_bg_threads = cast (int ,
1070- manager .background_worker_processes ) \
1071- or requested_api_threads
1074+ manager .background_worker_processes )
10721075 # Note that Queue under the hood uses OS-level primitives such as a socket
10731076 # or a pipe, where the read-write buffers have a **LIMITED** capacity, and
10741077 # are usually **NOT** backed by the full amount of available system memory.
@@ -1220,7 +1223,7 @@ def spawn_bg_process():
12201223 signal_log (LOG , "DEBUG" , f"Task child process { p .pid } started!" )
12211224 return p
12221225
1223- LOG .info ("Using %d Task handler processes ..." , requested_bg_threads )
1226+ LOG .info ("Using %d Task worker processes ..." , requested_bg_threads )
12241227 for _ in range (requested_bg_threads ):
12251228 spawn_bg_process ()
12261229
0 commit comments