You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running into some issues with database max pool size limit (lots of tasks running at the same time) and wanted to know what you think about creating an option to run tasks one by one? Or am I missing something?
Regards
The text was updated successfully, but these errors were encountered:
Yes, that's an issue that can come up. This used to be the way Coravel worked, but changed it for throughput reasons. I not sure adding this as an option should be a concern of Coravel proper....
There are other ways around this specific issue.
1
You create a static (or DI injected) class that handles creating all your DB connections. This will pool or just limit how many connections can be used at a given time.
Different interfaces could exist for something like this:
Under the covers, you would probably use a semaphore to limit how many actions can occur concurrently.
2
Another consideration: it might be that your code could be issuing too many SQL connections and that could be optimized.
3
Or, if your code gets a specific exception, you could handle that specific exception and retry in X milliseconds (with backoff, etc.) Many use something like Poly for that.
In this code you're runnning WhenAll making the tasks run in parallel, right?
coravel/Src/Coravel/Queuing/Queue.cs
Line 102 in 4a1b91d
I'm running into some issues with database max pool size limit (lots of tasks running at the same time) and wanted to know what you think about creating an option to run tasks one by one? Or am I missing something?
Regards
The text was updated successfully, but these errors were encountered: