Closed Adesin-fr closed 6 months ago
It's already possible, set the reservedConcurrency field on each function instead.
Nice ! Thanks for the trick, I had not understood it before !
Perhaps it should be interresting to put this on the docs or the default serverless.yml ?
Following #72 (Set maximum concurrency by default) :
There is already a function that allows to set the max concurrency on the whole project (as far I understood correctly). But imagine if the user sets a limit to 10, and puts a lot of heavy, long during jobs in the queue : 10 "workers" will start and run in parallel, but the limits will be hit and no more lambdas will be allowed to run to serve the web (if none were already started before)...
What would be a really usefull feature is to allow to set a limit for each stack (one limit for web, one limit for job workers), so each one can be scaled independantly.
That also could mitigate some issues where too much jobs are run in parallel against a DB that would not be able to handle hundrers of concurrent connections.
I think that to be able to acheive this, it would require to deploy two distinct projects instead of only one ? Perhaps it is possible to do it manually, but I couldnt figure how to set this up ?