Skip to content

Commit 2603574

Browse files
committed
Unix: increase the maximum number of preemptive threads
We require preemptive threads for reading DNS responses on Mac. The default maximum number of threads is quite small (4), so increase to 1024. Note that these threads are created on demand. Signed-off-by: David Scott <[email protected]>
1 parent 3e501e9 commit 2603574

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/bin/main.ml

+5
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,11 @@ let hvsock_addr_of_uri ~default_serviceid uri =
352352
if debug || env_debug then Some Logs.Debug else Some Logs.Info in
353353
Logging.setup log_destination level;
354354

355+
if Sys.os_type = "Unix" then begin
356+
Log.info (fun f -> f "Increasing preemptive thread pool size to 1024 threads");
357+
Uwt_preemptive.set_bounds (0, 1024);
358+
end;
359+
355360
let host_names = List.map Dns.Name.of_string @@ Astring.String.cuts ~sep:"," host_names in
356361
let dns_path, resolver = match dns with
357362
| None -> None, Configuration.default_resolver

0 commit comments

Comments
 (0)