Actix_web highest performance possible

⚓ Rust    📅 2026-02-13    👤 surdeus    👁️ 1      

surdeus

Hi folks,

I'm trying to get the highest thruput possible when using actix_web, but at 100 requests per second, the service is already failing. Am I missing something here?

#[actix_web::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(|| {
        App::new()
            .service(enrichment)
    })
    .bind(("0.0.0.0", 8080))?
    .workers(2) // Explicitly match c5.large vCPUs
    .backlog(4096) // Allow higher connection spikes
    .max_connections(5000) // Support high concurrency on a small instance
    .max_connection_rate(2000) // Smooth sudden floods and reduce accept backlog churn
    .keep_alive(KeepAlive::Timeout(Duration::from_secs(60))) // Keep connections warm without long-lived idles
    .run()
    .await
}

1 post - 1 participant

Read full topic

🏷️ Rust_feed