Hi!
I am working on a personal project that will use serverless functions extensively, which is a backend part I am still learning. I will use only async functions through the rest api.
One thing I noticed was the limits listed in the documentation.
So, I have a couple of questions:
Up to 120 concurrent functions
, does this mean 120 different functions being called at the time, or 120 invocations of any function running at the same time?This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hey @rafaeltragueta79,
Absolutely, let’s break it down:
Regarding the 120 concurrent functions, it’s about how many function invocations you can have running simultaneously, not the number of different functions. So yes, you can have 120 instances of your single async function executing at the same time.
When you reach this concurrency limit, DigitalOcean Functions will handle it gracefully. You’ll receive an error response for any invocation that exceeds this limit. This way, you can set up a retry mechanism in your code to handle such situations without keeping a count yourself.
As for the 600 invocations per minute limit, a managed service like DigitalOcean’s Managed Kafka is a great fit. You can produce events to a Kafka topic whenever you need to invoke a function. Then, your function can consume these events at a controlled pace that keeps you within the permissible rate. It’s a robust way to decouple your workload and manage spikes in demand.
Hope that helps!
- Bobby.