-
Notifications
You must be signed in to change notification settings - Fork 677
Open
Description
Hey folks I have a very simple grpc health endpoint (https://github.com/grpc-ecosystem/grpc-health-probe) and can observe a memory leak coinciding with the regular health check probes using up roughly half a GB every twelve hours in my specific deployment setting.
In fact I could reproduce it with something along the lines of
while true; do sleep 0.001; grpc_health_probe -addr localhost:50051; done
where I can reproduce the memory leak very quickly.
The solution I have found was to tune the grpc options and to add
'grpc.max_connection_idle_ms': 10000, // Close idle connections after 10s
'grpc.max_connection_age_ms': 30000, // Force connection close after 30s
I wanted to raise this here since I have seen multiple folks run into memory leaks and it was hard to find a workaround.
See
- channelz related memory leak (ServerHttp2Session) #2068
- grpc-health-probe shuts down the gRPC connection non-gracefully grpc-ecosystem/grpc-health-probe#34
Env: Linux, Node v22, @grpc/[email protected]
I believe a memory leak here is unfortunate even if it turns out it's the client disconnecting in wrong ways. Hope this helps.
DanielSharp01
Metadata
Metadata
Assignees
Labels
No labels