Fork me on GitHub
#pedestal
<
2022-02-23
>
orestis12:02:25

Is there a way, for a set of routes, to apply rate-limiting or lower priority or just confine them to a fixed number of threads so that they don't overrun the server? We're using jetty...

ghadi19:02:00

if they've made it into your routes, jetty is already handling them you may want to consider a rate-limiting load balancer in front of your service (e.g. API Gateway)

1
vemv19:02:08

in-app rate limiting makes sense IMO, if the resource being rate-limited isn't jetty itself e.g. if some route guards some special resource, maybe you want to rate-limit that specific resource

orestis19:02:49

I should probably look into jetty specifically, and see if it can do basic routing and strategies like this before handing over to pedestal itself. Eg a different queuing/buffering strategy.

orestis19:02:35

Unfortunately can't use api gateway yet. Or can I? Not sure if it can route to an ALB…

ghadi20:02:06

you can use a rate-limiting interceptor

ghadi20:02:30

rate information could be local or shared across instances (e.g. using a db) depending on requirements