Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions internal/backend/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ func RegisterGateway(
return memtrans.DialContext(dctx)
}),
grpc.WithSharedWriteBuffer(true),
// Disable idle mode: this is a permanent in-process loopback connection,
// so there is nothing to reclaim by going idle, and it avoids the
// first-request latency of re-establishing the connection after a quiet
// period.
grpc.WithIdleTimeout(0),
}

for srv, err := range servers {
Expand Down
5 changes: 5 additions & 0 deletions internal/backend/grpc/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ func NewRouter(
grpc.MaxCallRecvMsgSize(math.MaxInt32),
grpc.ForceCodecV2(proxy.Codec()),
),
// Disable idle mode: this is a permanent in-process loopback connection,
// so there is nothing to reclaim by going idle, and it avoids the
// first-request latency of re-establishing the connection after a quiet
// period.
grpc.WithIdleTimeout(0),
)
if err != nil {
return nil, fmt.Errorf("failed to dial omni backend: %w", err)
Expand Down
Loading