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
pd-client: share the connection when GetStoreMinResolvedTS from PD #922
Comments
@HuSharp Please take a look, thanks! |
related issue pingcap/tidb#43737 |
@AndreMouche @Connor1996 This is the reason why we need http api tikv/pd#6386
To focus on this issue, I tried to extend the api to get the stores together, which will reduce it to |
@HuSharp Why not provide a gRPC API? |
Oh, I misunderstood you, I'll provide the grpc that got all the store's ts or support for long connections later. |
/severity major |
Hi,
currently, we try to
GetStoreMinResolvedTS
for all stores from PD every 2 secondsclient-go/tikv/kv.go
Lines 602 to 607 in 719e645
Here we use http request and do not share the connections.
client-go/util/pd.go
Lines 89 to 94 in 719e645
This will be a problem (too many connection handshakes on PD) when there are a large number of tikv and tidb instances. For example when we have 100 tikvs and 100 tidbs, then the connections for
pd/api/v1/min-resolved-ts
to PD would be 100*100/2=5000 in 1 seconds. this will be a great pressure for PD. Meanwhile, From the above code on L92, it is possible that the first address is not the PD leader, and then it will cause the increasement of PD followers connections/CPU too.Here comes the suggestion: Use GRPC(pd-client) to GetStoreMinResolvedTS instead of http-client, which will share the connections and check the pd's leader regularly
The text was updated successfully, but these errors were encountered: