fix: adjust grpc keepalive parameters
This commit is contained in:
parent
664a92132b
commit
5987b0899c
3 changed files with 9 additions and 7 deletions
|
@ -152,7 +152,7 @@ export class ContainerConfigLoader {
|
|||
container.bind(TYPES.ApiGateway_SYNCING_SERVER_GRPC_URL).toConstantValue(env.get('SYNCING_SERVER_GRPC_URL'))
|
||||
const grpcAgentKeepAliveTimeout = env.get('GRPC_AGENT_KEEP_ALIVE_TIMEOUT', true)
|
||||
? +env.get('GRPC_AGENT_KEEP_ALIVE_TIMEOUT', true)
|
||||
: 8_000
|
||||
: 20_000
|
||||
|
||||
const grpcMaxMessageSize = env.get('GRPC_MAX_MESSAGE_SIZE', true)
|
||||
? +env.get('GRPC_MAX_MESSAGE_SIZE', true)
|
||||
|
@ -163,7 +163,6 @@ export class ContainerConfigLoader {
|
|||
container.get<string>(TYPES.ApiGateway_AUTH_SERVER_GRPC_URL),
|
||||
grpc.credentials.createInsecure(),
|
||||
{
|
||||
'grpc.keepalive_time_ms': grpcAgentKeepAliveTimeout * 2,
|
||||
'grpc.keepalive_timeout_ms': grpcAgentKeepAliveTimeout,
|
||||
'grpc.default_compression_algorithm': grpc.compressionAlgorithms.gzip,
|
||||
'grpc.default_compression_level': 2,
|
||||
|
@ -177,7 +176,6 @@ export class ContainerConfigLoader {
|
|||
container.get<string>(TYPES.ApiGateway_SYNCING_SERVER_GRPC_URL),
|
||||
grpc.credentials.createInsecure(),
|
||||
{
|
||||
'grpc.keepalive_time_ms': grpcAgentKeepAliveTimeout * 2,
|
||||
'grpc.keepalive_timeout_ms': grpcAgentKeepAliveTimeout,
|
||||
'grpc.default_compression_algorithm': grpc.compressionAlgorithms.gzip,
|
||||
'grpc.default_compression_level': 2,
|
||||
|
|
|
@ -84,16 +84,18 @@ void container.load().then((container) => {
|
|||
|
||||
serverInstance.keepAliveTimeout = httpKeepAliveTimeout
|
||||
|
||||
const grpcKeepAliveTime = env.get('GRPC_KEEP_ALIVE_TIME', true) ? +env.get('GRPC_KEEP_ALIVE_TIME', true) : 7_200_000
|
||||
|
||||
const grpcKeepAliveTimeout = env.get('GRPC_KEEP_ALIVE_TIMEOUT', true)
|
||||
? +env.get('GRPC_KEEP_ALIVE_TIMEOUT', true)
|
||||
: 10_000
|
||||
: 20_000
|
||||
|
||||
const grpcMaxMessageSize = env.get('GRPC_MAX_MESSAGE_SIZE', true)
|
||||
? +env.get('GRPC_MAX_MESSAGE_SIZE', true)
|
||||
: 1024 * 1024 * 50
|
||||
|
||||
const grpcServer = new grpc.Server({
|
||||
'grpc.keepalive_time_ms': grpcKeepAliveTimeout * 2,
|
||||
'grpc.keepalive_time_ms': grpcKeepAliveTime,
|
||||
'grpc.keepalive_timeout_ms': grpcKeepAliveTimeout,
|
||||
'grpc.default_compression_algorithm': grpc.compressionAlgorithms.gzip,
|
||||
'grpc.max_receive_message_length': grpcMaxMessageSize,
|
||||
|
|
|
@ -85,16 +85,18 @@ void container.load().then((container) => {
|
|||
|
||||
serverInstance.keepAliveTimeout = keepAliveTimeout
|
||||
|
||||
const grpcKeepAliveTime = env.get('GRPC_KEEP_ALIVE_TIME', true) ? +env.get('GRPC_KEEP_ALIVE_TIME', true) : 7_200_000
|
||||
|
||||
const grpcKeepAliveTimeout = env.get('GRPC_KEEP_ALIVE_TIMEOUT', true)
|
||||
? +env.get('GRPC_KEEP_ALIVE_TIMEOUT', true)
|
||||
: 10_000
|
||||
: 20_000
|
||||
|
||||
const grpcMaxMessageSize = env.get('GRPC_MAX_MESSAGE_SIZE', true)
|
||||
? +env.get('GRPC_MAX_MESSAGE_SIZE', true)
|
||||
: 1024 * 1024 * 50
|
||||
|
||||
const grpcServer = new grpc.Server({
|
||||
'grpc.keepalive_time_ms': grpcKeepAliveTimeout * 2,
|
||||
'grpc.keepalive_time_ms': grpcKeepAliveTime,
|
||||
'grpc.keepalive_timeout_ms': grpcKeepAliveTimeout,
|
||||
'grpc.default_compression_algorithm': grpc.compressionAlgorithms.gzip,
|
||||
'grpc.max_receive_message_length': grpcMaxMessageSize,
|
||||
|
|
Loading…
Reference in a new issue