#[tokio::main(worker_threads = 1)]
async fn main() {
let app = Router::new().route("/", get(root));
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
axum::Server::bind(&addr)
.serve(app.into_make_service())
.await
.unwrap();
}
async fn root() -> &'static str {
tokio::spawn(async move {
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
"success"
})
.await
.unwrap()
}
Complete requests: 100000 Concurrency Level: 10000
work threads | Time taken for tests | Requests per second |
---|---|---|
1 | 28 | 3566 |
8 | 28 | 3545 |
16 | 28 | 3523 |
工作线程数量怎么没用呀emmm
怎么才能实现这个
work threads | Time taken for tests | Requests per second |
---|---|---|
1 | 28 | 3566 |
2 | 14 | 7000 |
4 | 10 | 10000 |
8 | 10 | 10000 |
1
共 4 条评论, 1 页
评论区
写评论那我就不知道了
呀,大佬我试了一下,工作线程的数量对并发还是没影响啊
--
👇
苦瓜小仔:
Complete requests: 200000 Concurrency Level: 5000
大佬们,为什么工作线程对并发没起作用呀emm搞不明白