使用默认配置并发时产生500错误 #1095
Replies: 4 comments
-
从日志看:connect: cannot assign requested address。一般是由于Linux服务的TCP客户端端口耗尽了,需要调整一下默认的TCP参数。常用优化参数:
|
Beta Was this translation helpful? Give feedback.
-
请问一下有复用这些端口的方法么,如果是这个原因,听起来好像是新建一个链接就使用一个端口呢 |
Beta Was this translation helpful? Give feedback.
-
一个tcp连接由一个4元组确定:(源地址,源端口,目的地址,目的端口)。一个client发起请求时,目的地址和目的端口是固定的。通常情况下,源地址也只有1个IP地址,那么每次创建一个连接,一般都需要分配一个源端口。这部分知识更多细节,可以阅读《UNIX网络编程》第一卷。 |
Beta Was this translation helpful? Give feedback.
-
好的,谢谢啦 |
Beta Was this translation helpful? Give feedback.
-
使用代码中默认配置(删除了存活检测,连接超时设置成了和响应超时一样50000),吞吐大概超过2000时,会发生异常
部分日志:
[2023/01/30 01:53:47 UTC] [WARN] [1] (github.com/bfenetworks/bfe/bfe_server.(*ReverseProxy).clusterInvoke:286) cluster [cluster_example] select backend failed, err[BK_NO_BACKEND]
[2023/01/30 01:53:47 UTC] [INFO] [1] (github.com/bfenetworks/bfe/bfe_server.(*ReverseProxy).clusterInvoke:363) [cluster_example] [【地址隐去】] roundtrip ConnectError: dial tcp 【地址隐去】: connect: cannot assign requested address, 【地址隐去】
[2023/01/30 01:53:47 UTC] [INFO] [1] (github.com/bfenetworks/bfe/bfe_balance/bal_gslb.(*BalanceGslb).Balance:377) gslb.Balance():no backend(in cluster):cluster[cluster_example], sub[example.bfe.test], err[rr_bal:all backend is down]
[2023/01/30 01:53:47 UTC] [WARN] [1] (github.com/bfenetworks/bfe/bfe_server.(*ReverseProxy).clusterInvoke:286) cluster [cluster_example] select backend failed, err[BK_NO_BACKEND]
[2023/01/30 01:53:47 UTC] [INFO] [1] (github.com/bfenetworks/bfe/bfe_balance/backend.check:98) backend example_hostname back to Normal
[2023/01/30 01:53:47 UTC] [INFO] [1] (github.com/bfenetworks/bfe/bfe_server.(*ReverseProxy).clusterInvoke:363) [cluster_example] [【地址隐去】] roundtrip ConnectError: dial tcp 【地址隐去】: connect: cannot assign requested address, 【地址隐去】
[2023/01/30 01:53:47 UTC] [WARN] [1] (github.com/bfenetworks/bfe/bfe_server.(*ReverseProxy).clusterInvoke:286) cluster [cluster_example] select backend failed, err[BK_RETRY_TOOMANY]
[2023/01/30 01:53:47 UTC] [INFO] [1] (github.com/bfenetworks/bfe/bfe_server.(*ReverseProxy).clusterInvoke:363) [cluster_example] [【地址隐去】] roundtrip ConnectError: dial tcp 【地址隐去】: connect: cannot assign requested address, 【地址隐去】
[2023/01/30 01:53:47 UTC] [WARN] [1] (github.com/bfenetworks/bfe/bfe_server.(*ReverseProxy).clusterInvoke:286) cluster [cluster_example] select backend failed, err[BK_RETRY_TOOMANY]
[2023/01/30 01:53:47 UTC] [INFO] [1] (github.com/bfenetworks/bfe/bfe_server.(*ReverseProxy).clusterInvoke:363) [cluster_example] [【地址隐去】] roundtrip ConnectError: dial tcp 【地址隐去】: connect: cannot assign requested address, 【地址隐去】
[2023/01/30 01:53:47 UTC] [WARN] [1] (github.com/bfenetworks/bfe/bfe_server.(*ReverseProxy).clusterInvoke:286) cluster [cluster_example] select backend failed, err[BK_RETRY_TOOMANY]
[2023/01/30 01:53:47 UTC] [INFO] [1] (github.com/bfenetworks/bfe/bfe_server.(*ReverseProxy).clusterInvoke:363) [cluster_example] [【地址隐去】] roundtrip ReadRespHeaderError: read tcp 【地址隐去】: read: connection reset by peer
Beta Was this translation helpful? Give feedback.
All reactions