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

[ENH] Add flags to the go binary for concurrency and stream processing. #3449

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions go/cmd/coordinator/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ func init() {

// GRPC
flag.GRPCAddr(Cmd, &conf.GrpcConfig.BindAddress)
Cmd.Flags().IntVar(&conf.MaxConcurrentStreams, "max-concurrent-streams", 100, "Max concurrent streams")
Cmd.Flags().IntVar(&conf.MaxConcurrentStreams, "num-stream-workers", 100, "Number of stream workers")

// System Catalog
Cmd.Flags().StringVar(&conf.SystemCatalogProvider, "system-catalog-provider", "database", "System catalog provider")
Expand Down
3 changes: 3 additions & 0 deletions go/pkg/grpcutils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ type GrpcConfig struct {
// BindAddress is the address to bind the GRPC server to.
BindAddress string

MaxConcurrentStreams uint32
NumStreamWorkers uint32

// GRPC mTLS config
CertPath string
KeyPath string
Expand Down
2 changes: 2 additions & 0 deletions go/pkg/grpcutils/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ type defaultGrpcServer struct {
func newDefaultGrpcProvider(name string, grpcConfig *GrpcConfig, registerFunc func(grpc.ServiceRegistrar)) (GrpcServer, error) {
var opts []grpc.ServerOption
opts = append(opts, grpc.MaxRecvMsgSize(maxGrpcFrameSize))
opts = append(opts, grpc.NumStreamWorkers(grpcConfig.NumStreamWorkers))
opts = append(opts, grpc.MaxConcurrentStreams(grpcConfig.MaxConcurrentStreams))
if grpcConfig.MTLSEnabled() {
cert, err := tls.LoadX509KeyPair(grpcConfig.CertPath, grpcConfig.KeyPath)
if err != nil {
Expand Down
Loading