Browse Source

switch actix-pg to snmalloc (#5539)

Nikolay Kim 5 years ago
parent
commit
205c5149e1

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

@@ -31,8 +31,7 @@ actix-rt = "1.0.0"
 actix-codec = "0.2.0"
 actix-server = "1.0.0"
 actix-service = "1.0.1"
-jemallocator = "0.3.2"
-snmalloc-rs = "0.2.3"
+snmalloc-rs = "0.2.6"
 askama = "0.8"
 markup = "0.4.1"
 yarte = "0.3"

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

@@ -52,6 +52,7 @@ async fn main() -> std::io::Result<()> {
         .bind("techempower", "0.0.0.0:8080", || {
             HttpService::build()
                 .keep_alive(KeepAlive::Os)
+                .client_timeout(0)
                 .h1(map_config(
                     App::new()
                         .service(web::resource("/json").to(json))

+ 2 - 1
frameworks/Rust/actix/src/main_pg.rs

@@ -1,5 +1,5 @@
 #[global_allocator]
-static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
+static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;
 
 #[macro_use]
 extern crate serde_derive;
@@ -123,6 +123,7 @@ async fn main() -> std::io::Result<()> {
         .bind("techempower", "0.0.0.0:8080", move || {
             HttpService::build()
                 .keep_alive(KeepAlive::Os)
+                .client_timeout(0)
                 .h1(map_config(
                     App::new()
                         .data_factory(|| PgConnection::connect(DB_URL))

+ 1 - 0
frameworks/Rust/actix/src/main_platform.rs

@@ -158,6 +158,7 @@ fn main() -> std::io::Result<()> {
         .bind("techempower", "0.0.0.0:8080", || {
             HttpService::build()
                 .keep_alive(KeepAlive::Os)
+                .client_timeout(0)
                 .h1(AppFactory)
                 .tcp()
         })?