Deceivious
08/04/2023, 9:29 AMChris Reuter
08/04/2023, 12:01 PMDeceivious
08/04/2023, 12:10 PMChris Reuter
08/04/2023, 12:13 PMDeceivious
08/04/2023, 12:14 PMJenny
08/04/2023, 1:27 PMDeceivious
08/04/2023, 1:28 PMJenny
08/04/2023, 2:10 PMChris Pickett
08/04/2023, 2:23 PMconcurrency
context manager that’s not tied directly to a flow / task.
2. Concurrency limits can have ‘slot decay’, so if you have a flow run that fails often or you need rate-limiting like capability, you can have the locks on the limit decay over time, rather than be explicitly released.
However we will still have issues where if code completely crashes then locks will not be released. To that end the new concurrency
context manager emits events when it acquires and releases locks and will have related objects like the flow, task, deployment, etc. which should at least make it easier to find which ones have failed. The UI isn’t fully designed yet, but we also want to include a button so you can manually unlock slots or even disable a concurrency limit so it will no longer affect runs.
To that end it will affect implementations as it’s a completely separate feature from the current implementation.
Let me know if you have any more questions!Deceivious
08/04/2023, 2:28 PMprefect.concurrency
module internally in prefect so the user code will seamlessly work?Chris Pickett
08/04/2023, 2:39 PMDeceivious
08/08/2023, 7:46 AM/api/docs
. How does a user read / edit concurrency v2 limits via the API?Chris Pickett
08/10/2023, 1:44 AMDeceivious
09/08/2023, 1:26 PMChris Pickett
09/08/2023, 1:26 PMDeceivious
09/08/2023, 1:27 PMChris Pickett
09/08/2023, 1:27 PMDeceivious
09/08/2023, 1:33 PMChris Pickett
09/08/2023, 1:34 PMmanaging
section: https://docs.prefect.io/2.13.0/guides/global-concurrency-limits/#managing-global-concurrency-limits-and-rate-limits they’re created / edited, etc. from the UI.concurrency
.Deceivious
09/08/2023, 1:39 PMChris Pickett
09/08/2023, 1:56 PMDeceivious
09/08/2023, 1:56 PMChris Pickett
09/08/2023, 1:56 PMDeceivious
09/08/2023, 1:56 PMChris Pickett
09/08/2023, 1:57 PMDeceivious
09/08/2023, 1:58 PMChris Pickett
09/08/2023, 1:58 PMDeceivious
09/08/2023, 1:59 PMChris Pickett
09/08/2023, 1:59 PMDeceivious
09/08/2023, 2:01 PMChris Pickett
09/08/2023, 2:03 PMconcurrency
context manager will acquire a slot, and block code execution until it’s able to get one, then it’ll let your code run, and when your code exits the context manager it’ll release that slot back to be used by another process/task/etc. If you have slot decay configured a slot could open up before the concurrency manager explicitly releases it.Deceivious
09/08/2023, 2:04 PMChris Pickett
09/08/2023, 2:05 PMDeceivious
09/08/2023, 2:09 PMChris Pickett
09/08/2023, 2:12 PMrate_limit
function uses the same concurrency limits as the concurrency
context manager. It uses that same slot decay mechanism, so instead of explicitly releasing a slot it just uses the decay for management of the active slots. You can get something to run just 60 times per min, in my testing the best way I’ve found to make something like that happen is to create a Concurrency limit with a limit of 1
and a slot decay of 1
, that would mean that the slot will be available again every second, but feel free to mess around with a combination of slot decay and limit to see what works best for your use case.Deceivious
09/08/2023, 2:12 PMChris Pickett
09/08/2023, 2:14 PMDeceivious
09/08/2023, 2:25 PMlimit
. No matter how many tasks i run in parallel , the server would limit all the pending task until a slot is open right?Chris Pickett
09/08/2023, 2:27 PMDeceivious
09/08/2023, 2:27 PMChris Pickett
09/08/2023, 2:35 PMDeceivious
09/08/2023, 2:35 PMChris Pickett
09/08/2023, 2:36 PMDeceivious
09/08/2023, 2:39 PMChris Pickett
09/08/2023, 2:39 PMDeceivious
09/08/2023, 2:39 PM