File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -120,15 +120,6 @@ async def create_processes(self):
120
120
:raises RuntimeError: If process initialization or startup fails.
121
121
"""
122
122
# Processes limits and params
123
- num_processes = int (
124
- min (
125
- self .strategy .processes_limit or math .inf ,
126
- self .backend .processes_limit or math .inf ,
127
- settings .max_worker_processes ,
128
- )
129
- )
130
- if num_processes <= 0 :
131
- raise RuntimeError ("num_processes resolved to 0; increase limits/config" )
132
123
133
124
max_conc = int (
134
125
min (
@@ -140,6 +131,18 @@ async def create_processes(self):
140
131
if max_conc <= 0 :
141
132
raise RuntimeError ("max_concurrency resolved to 0; increase limits/config" )
142
133
134
+ num_processes = int (
135
+ min (
136
+ self .strategy .processes_limit or math .inf ,
137
+ self .backend .processes_limit or math .inf ,
138
+ settings .max_worker_processes ,
139
+ # Only spawn as many processes as we need for max_concurrency
140
+ max_conc ,
141
+ )
142
+ )
143
+ if num_processes <= 0 :
144
+ raise RuntimeError ("num_processes resolved to 0; increase limits/config" )
145
+
143
146
per_proc_max_conc = math .ceil (max_conc / num_processes )
144
147
per_proc_max_queue = min (2 , per_proc_max_conc )
145
148
max_queued_requests = ( # Add queue buffer for each process
You can’t perform that action at this time.
0 commit comments