-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
C-featureCategory: feature. This is adding a new feature.Category: feature. This is adding a new feature.
Description
I start hyper http2 server and load it with oha (https://github.com/hatoo/oha),
if there is one connection, the number of requests per second is X,
oha -z 2s -c 1 -p 100 --http-version=2 http://127.0.0.1:3000
if there are more than one connections, then the number of requests per second increases by 3 times. I run in single-threaded mode. I don't understand how this is possible
oha -z 2s -c 2 -p 100 --http-version=2 http://127.0.0.1:3000 Nothing like this is observed with other servers - if it is run in single-threaded mode, then there is no increase in requests per second from an increase in the number of connections
Do you have explanation for this effect?
Server code:
#[tokio::main(flavor = "current_thread")]
async fn main() {
let addr = ([127, 0, 0, 1], 3000).into();
let make_svc = make_service_fn(|_conn| {
async { Ok::<_, Infallible>(service_fn(handle_request)) }
});
let server = Server::bind(&addr)
.serve(make_svc)
.with_graceful_shutdown(async {
tokio::signal::ctrl_c().await.ok();
});
if let Err(e) = server.await {
eprintln!("{}", e);
}
}
Metadata
Metadata
Assignees
Labels
C-featureCategory: feature. This is adding a new feature.Category: feature. This is adding a new feature.