Skip to content

Commit

Permalink
fix: increase intiial window and connection window sizes
Browse files Browse the repository at this point in the history
For #4950

Signed-off-by: Dmitriy Matrenichev <[email protected]>
  • Loading branch information
DmitriyMV committed Mar 24, 2022
1 parent 7a88a02 commit 9b9191c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/app/apid/pkg/backend/apid.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ func (a *APID) GetConnection(ctx context.Context) (context.Context, *grpc.Client
a.conn, err = grpc.DialContext(
ctx,
fmt.Sprintf("%s:%d", net.FormatAddress(a.target), constants.ApidPort),
grpc.WithInitialWindowSize(65535*32),
grpc.WithInitialConnWindowSize(65535*16),
grpc.WithTransportCredentials(a.creds),
grpc.WithCodec(proxy.Codec()), //nolint:staticcheck
)
Expand Down
2 changes: 2 additions & 0 deletions pkg/grpc/factory/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ func NewDefaultOptions(setters ...Option) *Options {

opts.ServerOptions = append(
opts.ServerOptions,
grpc.InitialWindowSize(65535*32),
grpc.InitialConnWindowSize(65535*16),
grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(opts.UnaryInterceptors...)),
grpc.StreamInterceptor(grpc_middleware.ChainStreamServer(opts.StreamInterceptors...)),
)
Expand Down
2 changes: 2 additions & 0 deletions pkg/machinery/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ func (c *Client) GetConn(ctx context.Context, opts ...grpc.DialOption) (*grpc.Cl

dialOpts = append(dialOpts,
grpc.WithTransportCredentials(credentials.NewTLS(tlsConfig)),
grpc.WithInitialWindowSize(65535*32),
grpc.WithInitialConnWindowSize(65535*16),
)
}

Expand Down

0 comments on commit 9b9191c

Please sign in to comment.