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

Reuse gRPC connections instead of creating new ones #32

Open
Pitasi opened this issue Apr 13, 2022 · 1 comment
Open

Reuse gRPC connections instead of creating new ones #32

Pitasi opened this issue Apr 13, 2022 · 1 comment

Comments

@Pitasi
Copy link
Contributor

Pitasi commented Apr 13, 2022

Very similar to this api-server issue: EmerisHQ/demeris-api-server#108.

I would expect to only have one gRPC connection per chain. What we're currently doing instead is:

grpcConn, err := grpc.Dial(fmt.Sprintf("%s:%d", chainName, *port), grpc.WithInsecure())

DoD:

  • store connections, we can use the chain URL as key (fmt.Sprintf("%s:%d", chainName, *port)), gRPC can probably be configured to reconnect on failures so this store should never expire
  • store the "clients": e.g.
    bankQuery := bank.NewQueryClient(grpcConn)
    , since we have a single connection, there's no need to initialize new clients every time

⚠️ we are currently lacking a service mesh that will load balance requests among the available replicas (since we use a long lived TCP connection we remain connected to a single pod)

@akhilkumarpilli akhilkumarpilli self-assigned this Apr 19, 2022
@akhilkumarpilli
Copy link
Contributor

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

2 participants