Skip to content

Commit

Permalink
fix: setting gzip as default compression on grpc calls (#933)
Browse files Browse the repository at this point in the history
  • Loading branch information
karolsojko authored Nov 20, 2023
1 parent 7808cc8 commit 2dff6a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/api-gateway/src/Bootstrap/Container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ export class ContainerConfigLoader {
{
'grpc.keepalive_time_ms': grpcAgentKeepAliveTimeout * 2,
'grpc.keepalive_timeout_ms': grpcAgentKeepAliveTimeout,
'grpc.default_compression_algorithm': grpc.compressionAlgorithms.gzip,
'grpc.default_compression_level': 2,
},
),
)
Expand All @@ -177,6 +179,8 @@ export class ContainerConfigLoader {
{
'grpc.keepalive_time_ms': grpcAgentKeepAliveTimeout * 2,
'grpc.keepalive_timeout_ms': grpcAgentKeepAliveTimeout,
'grpc.default_compression_algorithm': grpc.compressionAlgorithms.gzip,
'grpc.default_compression_level': 2,
},
),
)
Expand Down
1 change: 1 addition & 0 deletions packages/auth/bin/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ void container.load().then((container) => {
const grpcServer = new grpc.Server({
'grpc.keepalive_time_ms': grpcKeepAliveTimeout * 2,
'grpc.keepalive_timeout_ms': grpcKeepAliveTimeout,
'grpc.default_compression_algorithm': grpc.compressionAlgorithms.gzip,
})

const gRPCPort = env.get('GRPC_PORT', true) ? +env.get('GRPC_PORT', true) : 50051
Expand Down
1 change: 1 addition & 0 deletions packages/syncing-server/bin/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ void container.load().then((container) => {
const grpcServer = new grpc.Server({
'grpc.keepalive_time_ms': grpcKeepAliveTimeout * 2,
'grpc.keepalive_timeout_ms': grpcKeepAliveTimeout,
'grpc.default_compression_algorithm': grpc.compressionAlgorithms.gzip,
})

const gRPCPort = env.get('GRPC_PORT', true) ? +env.get('GRPC_PORT', true) : 50051
Expand Down

0 comments on commit 2dff6a2

Please sign in to comment.