Hi Nic,

> I was wondering if there is a way to access the connection information of 
the server in order to see how many connections the server is currently 
responding to

One way that comes to mind is adding channelz 
<https://github.com/grpc/grpc/blob/master/src/proto/grpc/channelz/channelz.proto>
 
service to the server, and querying it for the data. Related link: 
https://cloud.google.com/traffic-director/docs/observability-proxyless#admin-interface
 
(`AdminInterface` includes channelz).
Otherwise, Java provides `ServerBuilder.addTransportFilter()` 
<https://grpc.github.io/grpc-java/javadoc/io/grpc/ServerBuilder.html#addTransportFilter-io.grpc.ServerTransportFilter->,
 
which can be used to track connections. Look up if there's something 
similar in Python/Go.

> Alternatively, does anyone have any suggestions for an alternate approach 
to this?

If you're using gRPC xDS, I'm working on adding Rate Limit Service 
<https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/ratelimit/v3/rls.proto>
 
support for server-side global rate limiting. This allows to offload 
throttling decisions to an external server.

Best regards,
Sergii

On Monday, October 4, 2021 at 1:14:51 AM UTC-7 nichola...@gmail.com wrote:

> Hi everyone,
>
> I'm looking to implement a rate limit interceptor for my gRPC services, 
> allowing for custom rate limiting based on the service's latency. I don't 
> need any advanced rate limit rules, just evaluating how many connections 
> have been made in total (no IP-based checks). I need to do this in both 
> Python and Go for my application. I was wondering if there is a way to 
> access the connection information of the server in order to see how many 
> connections the server is currently responding to? Alternatively, does 
> anyone have any suggestions for an alternate approach to this?
>
> Thanks in advance,
> Nic
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/bb29b4e4-9dbc-4508-b8b8-6a12e8e8852cn%40googlegroups.com.

Reply via email to