aio-libs / aio-libs/aiohttp

Add keepalive_requests and keepalive_time parameters for connection

Đang mở
#10,722 18 bình luận 0 reaction 0 người được giao Xem trên GitHub
client enhancement
Ngôn ngữ chính
Python
Star
16.5k
Fork
2.4k
Merge trung bình
17 giờ 22 phút
Pull request đã merge (30 ngày)
212

Mô tả

### Is your feature request related to a problem?

In the k8s environment, when the pod (behind ClusterIP Service) is scaled up, the new pod has almost no requests.

### Describe the solution you'd like

When the k8s pod is scaled up, the connection number between the new and old pods remains relatively balanced

### Describe alternatives you've considered

For example, nginx sets an upper limit on the number of requests and a time limit for each connection. If the limit is exceeded, the connection is disconnected, so that new pods of the service will also have the opportunity to receive new requests.
[keepalive_requests](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive_requests)
[keepalive_time](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive_time)

### Related component

Client

### Additional context

When I was stress testing the backend service, after the k8s pod was scaled up, the CPU usage of the new and old pods differed greatly because the new pods had much fewer connections than the old pods.

![Image](https://github.com/user-attachments/assets/0960721a-fe8d-47bb-88a7-a26cddc173d6)

### Code of Conduct

- [x] I agree to follow the aio-libs Code of Conduct

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

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

Đánh giá

Issue này chưa được đánh giá.

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.