diff --git a/Cargo.lock b/Cargo.lock index 28034f247..a56209730 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6045,6 +6045,7 @@ dependencies = [ "restate-tracing-instrumentation", "restate-types", "restate-worker", + "rlimit", "schemars", "serde", "serde_with", @@ -6462,6 +6463,15 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rlimit" +version = "0.10.1" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "3560f70f30a0f16d11d01ed078a07740fe6b489667abc7c7b029155d9f21c3d8" +dependencies = [ + "libc", +] + [[package]] name = "rocksdb" version = "0.22.0" diff --git a/Cargo.toml b/Cargo.toml index 189a7e83a..8192aca1f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,6 +121,7 @@ prost-build = "0.12.1" prost-types = "0.12.1" rand = "0.8.5" rayon = { version = "1.10" } +rlimit = { version = "0.10.1" } rocksdb = { version = "0.22.0", features = ["multi-threaded-cf"], git = "/~https://github.com/restatedev/rust-rocksdb", rev="64a3c698910380e4fcbd8e56ce459779932cf1ff" } rustls = "0.21.6" schemars = { version = "0.8", features = ["bytes", "enumset"] } diff --git a/server/Cargo.toml b/server/Cargo.toml index 61f502f43..09476fda0 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -47,6 +47,7 @@ humantime = { workspace = true } notify = { version = "6.0.1" } notify-debouncer-mini = { version = "0.4.1" } pin-project = { workspace = true } +rlimit = { workspace = true } schemars = { workspace = true, optional = true } serde = { workspace = true } serde_with = { workspace = true } diff --git a/server/src/main.rs b/server/src/main.rs index 1df812446..57b332fb4 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -158,7 +158,9 @@ fn main() { // Setting initial configuration as global current restate_types::config::set_current_config(config); - + if rlimit::increase_nofile_limit(u64::MAX).is_err() { + warn!("Failed to increase the number of open file descriptors limit."); + } let tc = TaskCenterBuilder::default() .options(Configuration::pinned().common.clone()) .build()