Configuring In-function Concurrency

Learn how to allow multiple requests to share a single function instance.
Table of Contents

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:

  1. Navigate to your project in the Vercel dashboard.
  2. Click on the Settings tab and select the Functions section.
  3. Scroll to the In-function concurrency section.
  4. Toggle the switch to Enabled, and click Save.
  5. 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:

  1. Choose your project from the dashboard.
  2. Click on the Settings tab and select the Functions section and scroll to the In-function concurrency section.
  3. 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.

Last updated on October 14, 2024