Closed caihonghaoCYF closed 1 month ago
--------------------------pingora------------------------------- [root@10 demo01]# wrk -t 4 -c 50 -d 30s http://127.0.0.1:6188 Running 30s test @ http://127.0.0.1:6188 4 threads and 50 connections Thread Stats Avg Stdev Max +/- Stdev Latency 63.57ms 249.95ms 1.94s 95.57% Req/Sec 1.09k 370.03 2.56k 71.35% 121194 requests in 30.11s, 225.26MB read Non-2xx or 3xx responses: 121194 Requests/sec: 4025.48
--------------------------nginx------------------------------- [root@10 demo01]# wrk -t 4 -c 50 -d 30s http://127.0.0.1:9080 Running 30s test @ http://127.0.0.1:9080 4 threads and 50 connections Thread Stats Avg Stdev Max +/- Stdev Latency 18.12ms 93.98ms 1.00s 96.49% Req/Sec 24.53k 15.85k 70.03k 68.82% 2768119 requests in 30.09s, 435.58MB read Requests/sec: 92006.88 Transfer/sec: 14.48MB
Non-2xx or 3xx responses: 121194
Pingora will close the connection if fail_to_proxy
, please refer to #190
I get it. Thx~
Describe the bug
When I pressure tested pingora with wrk, I found that qps was low, general-purpose machines, and nginx was normal。
Pingora info
pub struct HttpEchoApp;
[async_trait]
impl ServeHttp for HttpEchoApp { async fn response(&self, http_stream: &mut ServerSession) -> Response<Vec> {
// read timeout of 2s
let read_timeout = 2000;
let body = match timeout(
Duration::from_millis(read_timeout),
http_stream.read_requestbody(),
)
.await
{
Ok(res) => match res.unwrap() {
Some(bytes) => bytes,
None => Bytes::from("no body!"),
},
Err() => {
panic!("Timed out after {:?}ms", read_timeout);
}
};
}
pub fn new_http_echo_app() -> Arc {
Arc::new(HttpEchoApp {})
}
pub fn echo_service_http() -> Service {
Service::new("Echo Service HTTP".to_string(), new_http_echo_app())
}
fn main() { println!("ready to start server!!!!");
}