ServerError: Rate limit exceeded consumedPoints

Hi,

can anyone explain to me in detail how the rate limit works? I Am using node red to create 9000 workitems as fast as possible and run into this error, i could just raise any number related to that but would rather understand how this system works exactly.

I Assume the following are the relevant settings:

So could anyone explain to me what exactly happens when i send one workitem add from node red and how it affects those values?

Greetings

Yeah, it’s explained on Configuration Values | OpenIAP Documentation

But reading it, I feel it deserves more details, I will add those tomorrow.

Just know api_rate is for website assets and the openapi interface. Once a connection is open using gRPC/websocket, it is the socket_rate ones that are used.

OpenCore uses rate limiting in two places.

  • We use Express as a web server, and for all requests, we start by checking if you hit the rate limit. We do this by IP. Not ideal, but better than nothing. Every time you make a request, you use a point. If you use more than 1000 points (api_rate_limit_points) within one second (api_rate_limit_duration), the request is discarded with an HTTP code 429.

  • All client SDKs create a connection to OpenCore and keep it alive. For every connection, we also create two rate limiters, so this one is “per person”/per connection. Again, for every command you send, you use one point, and if you use more than 1000 points (socket_rate_limit_points) within a second (socket_rate_limit_duration), you will receive an error for the command. If you keep sending messages despite the errors and you reach 1600 points (socket_rate_limit_points_disconnect), the connection gets disconnected. For the other limiter, you receive a point for every error you receive; if you get more than 30 errors (socket_error_rate_limit_points) within a second (socket_error_rate_limit_duration), the connection gets disconnected.

By that logic: if I limit add workitem to 500/s it should not throw an exception, but it does? What could be the problem then?

it’s not using a sliding window, so you cannot do 500, wait up to 1 sec and then do 500 again,
also, this is why we have push workitems, to push multiple at the time .. why not batch it using that ?

How is it working then?

this is why we have push workitems, to push multiple at the time .. why not batch it using that ?

tbh? Because till you just mentioned it, i never saw that xD will be using that now xD

is this nodered, openrpa or one of the client sdk’s ?

Node-RED i have a split and a delay in front of a single add workitem. The delay was set to 500msg/s.

I switched now to bulk add but still interested in learning how it works.

Sorry, you are asking how bulk works, but you now using it?
I feel I don’t understand the question properly?

it’s not using a sliding window, so you cannot do 500, wait up to 1 sec and then do 500 again,

I am curious why this doesn’t work since your explanation was that after 1 second the counter gets reset.

Ahh… The protocol supports doing multiples, so pushworkitems is not calling pushworkitem multiple times. It’s a command for doing multiple in one go. This is faster because we do not have a round trip for each item, and it only counts for one point in the rate limiter since you only executed one command.

this is the same for InsertMany, UpdateMany and InsertOrUpdateMany

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.