actix / actix-web

Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.
https://actix.rs
Apache License 2.0
21.74k stars 1.68k forks source link

Even simpliest app hangs after serving 16K requests during Apache Benchmark load test #2845

Closed mlesin closed 2 years ago

mlesin commented 2 years ago

Expected Behavior

It should continue serving requests

Current Behavior

Here is current log from ab:

This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 2000 requests
Completed 4000 requests
Completed 6000 requests
Completed 8000 requests
Completed 10000 requests
Completed 12000 requests
Completed 14000 requests
Completed 16000 requests
apr_pollset_poll: The timeout specified has expired (70007)
Total of 16348 requests completed

Possible Solution

Steps to Reproduce (for bugs)

  1. Compile and run the simpliest actix-web app I can imagine (with single dependency in Cargo.toml (actix-web = "4.1.0") :
    
    use actix_web::{web, App, HttpResponse, HttpServer};

async fn simple() -> HttpResponse { HttpResponse::Ok().json("something") }

[actix_web::main]

async fn main() { println!("Starting server at http://127.0.0.1:8080",); HttpServer::new(move || App::new().service(web::resource("/").route(web::get().to(simple)))) .bind(("127.0.0.1", 8080)) .expect("successful bind") .run() .await .unwrap(); }

2. While it is running, fire the following command in terminal:
```bash
ab -c 1 -n 20000 -s 5 http://localhost:8080/

Context

I've tried previos major version of actix-web (3.3.3), it fails with the same result

Your Environment

Mac OS X 12.5.1 4-core CPU with Hyper Threading enabled, 16GB RAM

mlesin commented 2 years ago

Sorry for bothering, it seems this problem is unrelated to actix and more specific to OSX platform itself.

fmcarvalho commented 9 months ago

@mlesin, I am experiencing the same behavior on Mac for a Spring WebFlux server. Since you mentioned that it might be more specific to the OSX platform, I was wondering if you have resolved it and what the OSX-related problem might be?

mlesin commented 9 months ago

@mlesin, I am experiencing the same behavior on Mac for a Spring WebFlux server. Since you mentioned that it might be more specific to the OSX platform, I was wondering if you have resolved it and what the OSX-related problem might be?

I didn't even tried to solve it because I'm using OSX only for developing, while production runs on Linux without such issues, sorry.