-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
balancer: create many tcp connections use the same endpoint #11371
Comments
I recived a reply from grpc-go community like this:
And I agree with that etcd client need to full control about create TCP connections. |
this is the behavior of the old etcd grpc client. i think the team made the decision to pre create tcp connections with every given endpoint. and we feel it is fine since the number of etcd server should be small. what is your concern on creating a tcp connection on ever given etcd server endpoint? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@xiang90 is right. The main motivation was to "simplify" the previous implementation. The old balancer used to keep only one connection, but the code became too complicated and error-prone. |
ping...ping... |
I found a similar bug #grpc/grpc-go#3667 , fixed by #grpc/grpc-go#2985 . |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions. |
What version of etcd are you using?
3.3.17
What version of Go are you using (
go version
)?go version go1.13.1 linux/amd64
What operating system (Linux, Windows, …) and version?
CentOS release 6.5 * 2
What did you do?
Client: 192.168.1.199
Etcd Node A:192.168.1.101
What did you expect to see?
step 1 : run the code
set iptables command
set iptables command on etcd node A After
start goroutine
strings display to simulate CPU busy, and can't accept TCP socket.check TCP connections number
There are 6~7 connections with
SYN_SENT
status TCP connection.In fact, It will create a tcp connection with every endpoints
Etcd client create many tcp connects with the same endpoint when client balancer works.
What did you see instead?
It create one tcp connection only ,or create an other tcp socket insead when connect failed.
More detail
casestudy
In my case, that is SYN-FLOOD attack.
etcd cluster:7 nodes
etcd clients:200K +
DB size:6-8G
supervisor
pulls etcd process up again.tryAllAddrs
function, retry all endpoints with a backoff mechanism.hb.healthCheckTimeout
(min 3S, max set by client connect) in thehealthBalancer.updateUnhealthy
function, triggertryAllAddrs
again, reconnect all of endpoints.bugs
The text was updated successfully, but these errors were encountered: