Configuring In-function Concurrency
Learn how to allow multiple requests to share a single function instance.In-function concurrency is available in Beta on Pro and Enterprise plans
You can only configure concurrency for functions using the Node.js runtime. Edge Functions cannot be configured.
The in-function concurrency feature lets multiple requests share a single function instance, and is available only for functions using the Node.js runtime. To learn more about how this works, see the Efficient serverless Node.js with in-function concurrency blog post.
This feature is ideal for I/O-bound tasks like database operations or API requests, as it makes better use of system resources. However, enabling this feature may introduce latency for CPU-intensive tasks such as image processing, LLM training, or large matrix calculations, this is a beta constraint that we are working to improve.
You must have enabled at least 1vCPU of memory (i.e. Standard or Performance) in order to enable concurrency for your functions. To learn more, see Setting your default function CPU size.
To enable the feature:
- Navigate to your project in the Vercel dashboard.
- Click on the Settings tab and select the Functions section.
- Scroll to the In-function concurrency section.
- Toggle the switch to Enabled, and click Save.
- Redeploy your project to apply the changes.
Concurrency is now enabled for all functions in that project.
Once enabled, you can view the GB-Hours saved:
- Choose your project from the dashboard.
- Click on the Settings tab and select the Functions section and scroll to the In-function concurrency section.
- Next to the toggle, click the View in-function concurrency metrics link.
From here, you'll be able to see total consumed and saved GB-Hours, and the ratio of the saved usage.
Was this helpful?