Browse Source

astra: increase thread pool size (#7388)

* astra: increase thread pool size

* astra: add required dependencies

* astra: disable `mimalloc` security features
Ibraheem Ahmed 3 years ago
parent
commit
63d15aa0fe
2 changed files with 3 additions and 1 deletions
  1. 2 1
      frameworks/Rust/astra/Cargo.toml
  2. 1 0
      frameworks/Rust/astra/src/main.rs

+ 2 - 1
frameworks/Rust/astra/Cargo.toml

@@ -5,8 +5,9 @@ edition = "2021"
 
 [dependencies]
 astra = "0.1.2"
+num_cpus = "1.13.1"
 http = "0.2.6"
-mimalloc = "0.1"
+mimalloc = { version = "0.1", default-features = false }
 simd-json = "0.4"
 serde = { version = "1.0", features = ["derive"] }
 

+ 1 - 0
frameworks/Rust/astra/src/main.rs

@@ -6,6 +6,7 @@ use http::StatusCode;
 
 fn main() {
     Server::bind("0.0.0.0:8080")
+        .max_workers(num_cpus::get() * 20)
         .http1_pipeline_flush(true)
         .http1_only(true)
         .serve(serve)