-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit concurrency of zonal statistics jobs #228
Comments
Already discussed a bit with @vincentsarago here NASA-IMPACT/veda-ui#660 (comment) |
@j08lue looking back at this I think I misunderstood the original issue. This is not related to titiler-pgstac but more a frontend (allowing the user such a big interval) / backend configuration (number of concurrent lambda as pointed but @amarouane-ABDELHAK) issue. |
Ah, I just realized that it is the client (frontend) that issues all the parallel requests. I had assumed that the frontend made a single request and then the backend would calculate and spawn all the processing jobs. Yes, in that case, it is just a matter of limiting what users do in the UI. Plus safeguarding that concurrency limit in AWS, if possible. |
Limits implemented in FE. |
Currently, if a single user requests zonal statistics for 3 years worth of daily data, that will fire off more than 1000 Lambda executions at the exact same time. 1000 is the default global account limit of concurrent requests. We can easily increase that (we just requested 10k, just in case), but such a massive concurrent execution is probably not a good idea.
We need to address this programmatically - even when a user sends off a request like this, it should get rejected (gracefully) by the API. Maybe we can also reduce concurrency in the backend by limiting the number of "workers" that handle the per-file extraction jobs?
As @amarouane-ABDELHAK pointed out, another guardrail to put on could be to limit the number of concurrent Lambda executions for the worker Lambda, if that is possible. That way, executions of this particular function will not be able to exhaust the global account limit.
Acceptance criteria
The text was updated successfully, but these errors were encountered: