Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http RoundTripper 支持自动断开空闲连接 #1031

Open
shiw13 opened this issue Mar 18, 2022 · 2 comments
Open

http RoundTripper 支持自动断开空闲连接 #1031

shiw13 opened this issue Mar 18, 2022 · 2 comments
Labels
good first issue Good for newcomers
Projects
Milestone

Comments

@shiw13
Copy link
Contributor

shiw13 commented Mar 18, 2022

问题

本地测试 http 1.1 转发,发现bfe貌似会一直保持和后端服务之间的tcp连接,每条连接会占用2条协程,导致空闲后 协程也还在。

解决方案

bfe能否支持配置 空闲连接超时时间,超时后自动断开。也就是标准库里面的 http.Transport IdleConnTimeout

// IdleConnTimeout is the maximum amount of time an idle
// (keep-alive) connection will remain idle before closing
// itself.
// Zero means no limit.
@mileszhang2016
Copy link
Member

很好的建议。我们后续会考虑一下这个需求。谢谢。

@iyangsj iyangsj added the good first issue Good for newcomers label Jul 29, 2022
@iyangsj iyangsj added this to the Proposal milestone Jul 29, 2022
@iyangsj iyangsj added this to To do in BFE 1.0 via automation Jul 29, 2022
@Tovi163
Copy link
Collaborator

Tovi163 commented Sep 18, 2023

问题

本地测试 http 1.1 转发,发现bfe貌似会一直保持和后端服务之间的tcp连接,每条连接会占用2条协程,导致空闲后 协程也还在。

解决方案

bfe能否支持配置 空闲连接超时时间,超时后自动断开。也就是标准库里面的 http.Transport IdleConnTimeout

// IdleConnTimeout is the maximum amount of time an idle
// (keep-alive) connection will remain idle before closing
// itself.
// Zero means no limit.

是否可以补充下测试方法;另外测试中是否开启了连接池

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
BFE 1.0
  
To do
Development

No branches or pull requests

4 participants