resgateio / resgate

A Realtime API Gateway used with NATS to build REST, real time, and RPC APIs, where all your clients are synchronized seamlessly.
https://resgate.io
MIT License
685 stars 67 forks source link

Throttling reset requests #187

Closed jirenius closed 3 years ago

jirenius commented 3 years ago

Issue

When Resgate receives a system.reset request, it will generate get and/or access requests for all matching resources. If a lot of resources matches the pattern, the service(s) may be overwhelmed, failing to respond within Resgate's default timeout period of 3 seconds. This will in turn result in Resgate sending unsubscribe events to the clients for any timed out resource.

Solution

It should be possible to throttle the number of concurrent requests being sent on system.reset. This can be done by introducing a single integer configuration value:

jirenius commented 3 years ago

Resolved in PR #201