Limit memory usage of gRPC server using channel arguments

42 views
Skip to first unread message

Andrzej Gałka

unread,
Jul 10, 2025, 10:48:36 AM7/10/25
to grpc.io
Hi Folks,
i'm facing an out of memory problem due to too many requests sending to gRPC server in the short period of time. The gRPC server is working at K8s platform with limited memory. Usually, the server works fine, but when the traffic increases rapidly ( short-term peak ) , memory consumption rises to the limit, and k8 kills the app. I know that the gRPC library offers a ResourceQuota mechanism attached to the client channel via ChannelArguments but I'm not sure what the configuration should look like and cannot find any useful example on the internet. It's the 3rd part app, so adding a memory quota into  the application code is not an option. i'm trying to solve the problem without additional external solution e.g. sidecar proxy.  Configuring resource quota via channel arguments passed as command line argument sounds reasonable for me.
any suggestions and recommendations welcome

Thank you,
Andrzej
Reply all
Reply to author
Forward
0 new messages