actix / actix/actix-web

[Windows] Web Client is unreasonably slow

Đang mở
#2,256 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
24.8k
Fork
1.9k
Merge trung bình
23 giờ 10 phút
Pull request đã merge (30 ngày)
26

Mô tả

Reproduce snippet:
```rust
#[actix_web::main]
async fn main() -> std::io::Result<()> {
let sys_time = std::time::SystemTime::now();
let start_time = sys_time.elapsed().unwrap();

let client = actix_web::client::Client::builder()
.connector(actix_web::client::Connector::new()
.timeout(Duration::from_secs(35))
.finish())
.timeout(Duration::from_secs(35))
.finish();

let response = client.get("https://google.com")
.send()
.await
.unwrap()
.body()
.await
.unwrap();
let end_time = sys_time.elapsed().unwrap();
let secs = end_time - start_time;
println!("{}", secs.as_secs());
return Ok(());
}
```

This code prints "20" on Windows, i.e. get request to Google takes 20 seconds.

Same code on Linux (WSL2) takes 0 seconds.

I don't have any clues what might be wrong, but perhaps it's related to DNS resolution?

`Cargo.toml`:
```toml
// ...

[dependencies]
actix-web = { version = "3", features = ["rustls"] }
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start with the Rust client code in the reproduction and the actix-web version 3 dependency in Cargo.toml. Run the snippet on Windows and Linux/WSL2, then investigate the request path and DNS-resolution hypothesis. Done means the same Google request no longer takes about 20 seconds on Windows and the behavior is covered by an appropriate regression test.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
rust
Lĩnh vực
networking
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.