Skip to content

Spanner Pool enhancements #184

Open
Open
@pjenvey

Description

@pjenvey

We cut a couple corners while building the Pool impl. We should cleanup the following:

  • Cache the Service Account Access. We currently reload the token from disk whenever creating a Connection
  • We need a way to specify the Service Account file (environment variable?) and accompanying loading of it (the new client SDK will handle this for us)
  • We never implemented is_valid/has_broken
  • kill any .unwrap()s

Further improvements (2019-10-22):

  • Multiplex SpannerClient "connections" on top of grpc::Channel (via cloning the channel per SpannerClient)
  • Not only should we "cache" the service account access (they should be singletons inside the SpannerConnectionManager), but also the grpcio Env and channels themselves
  • Spanner's docs recommend pooling 100 connections because 100 is the maximum number of concurrent sessions per gRPC channel. Local testing shows syncstorage-rs handling > 100 simultaneous users/db connections from the loadtester. So we should not only maintain a pool of SpannerClient "connections" but underneath that a pool of grpc Channels, with each Channel capable of 100 "connections"

Metadata

Metadata

Assignees

Labels

8Estimate - xl - Moderately complex, medium effort, some uncertainty.enhancementNew feature or requestsync-modernization

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions