From d46b37f6a8639e25ff54ea1e264cc7cebdd03be9 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 13 Apr 2021 16:24:45 +0200 Subject: feat(cli): raise file descriptor limit on startup (#10162) Raise the soft limit to the hard limit when possible. This is similar to what Node.js does to avoid running into "out of file descriptors" errors too quickly. On most Linux systems, raises the limit from 1,024 to 1,048,576. On most macOS systems, raises the limit from 256 to 10,240. Fixes #10148. --- cli/main_runtime.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cli/main_runtime.rs') diff --git a/cli/main_runtime.rs b/cli/main_runtime.rs index db3f9fd02..23f1c23b6 100644 --- a/cli/main_runtime.rs +++ b/cli/main_runtime.rs @@ -5,6 +5,7 @@ mod colors; mod standalone; mod tokio_util; +mod unix_util; mod version; use deno_core::error::anyhow; @@ -14,6 +15,7 @@ use std::env; pub fn main() { #[cfg(windows)] colors::enable_ansi(); // For Windows 10 + unix_util::raise_fd_limit(); let args: Vec = env::args().collect(); if let Err(err) = run(args) { -- cgit v1.2.3