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

为什么只有连接池模式才能关闭空闲连接 #926

Closed
ufosky opened this issue Sep 20, 2019 · 7 comments
Closed

为什么只有连接池模式才能关闭空闲连接 #926

ufosky opened this issue Sep 20, 2019 · 7 comments

Comments

@ufosky
Copy link
Contributor

ufosky commented Sep 20, 2019

看文档只支持连接池模式关闭空闲连接,但我们现在用的单连接的模式,怎么关闭空闲连接 https://github.com/apache/incubator-brpc/blob/master/docs/cn/client.md#%E5%85%B3%E9%97%AD%E8%BF%9E%E6%8E%A5%E6%B1%A0%E4%B8%AD%E7%9A%84%E9%97%B2%E7%BD%AE%E8%BF%9E%E6%8E%A5

@cdjingit
Copy link
Contributor

单连接为啥还有空闲连接? 单连接只有节点被naming service移除后自然会被关闭。

@ufosky
Copy link
Contributor Author

ufosky commented Sep 20, 2019

因为策略上的原因,需要在流量上升时用到某些节点,但是大部分时间应该是用不到的

@cdjingit
Copy link
Contributor

流量低的时候摘除这些backup节点就可以了。你们现在怎么管理?

@ufosky
Copy link
Contributor Author

ufosky commented Sep 20, 2019

backup节点也有另外的服务在用,就是说流量高的时候会分一部分流量到别的服务的节点,但平时都走正常节点,关闭不必要的连接

@ufosky
Copy link
Contributor Author

ufosky commented Sep 20, 2019

如果要让单连接模式可以关闭空闲连接,可以怎么实现?

@cdjingit
Copy link
Contributor

如果要让单连接模式可以关闭空闲连接,可以怎么实现?

如果节点没有被ns移除,你们如何让他空闲下来的?(如何让lb不选择这些backup节点?)

@ufosky
Copy link
Contributor Author

ufosky commented Sep 23, 2019

使用SelectiveChannel将正常节点和备用节点放到不同的subchannel里面,然后通过策略让一般情况选择正常节点的subchannel,但是现在的问题是一旦备用节点的channel建立了连接,就一直不断开了

@wwbmmm wwbmmm closed this as completed Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants