Vercel Functions Limits

Learn about the limits and restrictions of using Vercel Functions with the Node.js runtime.
Table of Contents

The table below outlines the limits and restrictions of using Vercel Functions with the Node.js runtime:

FeatureNode.js
Maximum memoryHobby: 1024 MB, Pro and Ent: 3009 MB
Maximum durationHobby: 10s (default) - configurable up to 60s, Pro: 15s (default) - configurable up to 300s, Ent: 15s (default) - configurable up to 900s. If fluid compute is enabled, these values are increased across plans. See max durations for more information.
Size (after gzip compression)250 MB
ConcurrencyAuto-scales up to 30,000 (Hobby and Pro) or 100,000+ (Enterprise) concurrency
CostPay for wall-clock time
RegionsExecutes region-first, can customize location.
Enterprise teams can set multiple regions
API CoverageFull Node.js coverage

The following limits apply to the function's name when using Node.js runtime:

  • Maximum length of 128 characters. This includes the extension of the file (e.g. apps/admin/api/my-function.js is 29 characters)
  • No spaces are allowed. Replace them with a - or _ (e.g. api/my function.js isn't allowed)

Vercel places restrictions on the maximum size of the deployment bundle for functions to ensure that they execute in a timely manner.

For Vercel Functions, the maximum uncompressed size is 250 MB including layers which are automatically used depending on runtimes. These limits are enforced by AWS.

You can use includeFiles and excludeFiles to specify items which may affect the function size, however the limits cannot be configured. These configurations are not supported in Next.js, instead use outputFileTracingIncludes.

Edge Functions have plan-dependent size limits. This is the total, compressed size of your function and its dependencies after bundling.

This refers to the longest time a function can process an HTTP request before responding.

Functions using the Edge runtime do not have a maximum duration. They must begin sending a response within 25 seconds and can continue streaming a response beyond that time.

While Vercel Functions have a default duration, this duration can be extended using the maxDuration config. If a Vercel Function doesn't respond within the duration, a 504 error code (FUNCTION_INVOCATION_TIMEOUT) is returned.

Vercel Functions have the following defaults and maximum limits for the duration of a function:

DefaultMaximum
Hobby10s60s
Pro15s300s
Enterprise15s900s

If you have enabled fluid compute, the following defaults and maximum limits apply (Applies to the Node.js and Python runtimes):

DefaultMaximum
Hobby60s60s
Pro90s800s
Enterprise90s800s

Vercel Functions have the following defaults and maximum limits:

DefaultMaximum
Hobby1024 MB / 0.6 vCPU1024 MB / 0.6 vCPU
Pro /Enterprise1769 MB / 1 vCPU3009 MB / 1.7 vCPU

Users on Pro and Enterprise plans can configure the default memory size for all functions in the dashboard, or on a per-function basis in your vercel.json.

The maximum size for a Function includes your JavaScript code, imported libraries and files (such as fonts), and all files bundled in the function.

If you reach the limit, make sure the code you are importing in your function is used and is not too heavy. You can use a package size checker tool like bundle to check the size of a package and search for a smaller alternative.

In Vercel, the request body size is the maximum amount of data that can be included in the body of a request to a function.

The maximum payload size for the request body or the response body of a Vercel Function is 4.5 MB. If a Vercel Function receives a payload in excess of the limit it will return an error 413: FUNCTION_PAYLOAD_TOO_LARGE. See How do I bypass the 4.5MB body size limit of Vercel Functions for more information.

Node.js runtime (and more)
Geolocation dataYes
Access request headersYes
Cache responsesYes

The Hobby plan offers functions for free, within limits. The Pro plan extends these limits, and charges usage based on Function Duration for Vercel Functions.

Function duration for Vercel Functions is based on Wall-clock time , which refers to the actual time elapsed during a process, similar to how you would measure time passing on a wall clock. It includes all time spent from start to finish of the process, regardless of whether that time was actively used for processing or spent waiting for a streamed response.

It is important to make sure you've set a reasonable maximum duration for your function. See "Managing usage and pricing for Vercel Functions" for more information.

If you have fluid compute enabled, the following environment variables are not accessible you cannot log them:

  • AWS_EXECUTION_ENV
  • AWS_LAMBDA_EXEC_WRAPPER
  • AWS_LAMBDA_FUNCTION_MEMORY_SIZE
  • AWS_LAMBDA_FUNCTION_NAME
  • AWS_LAMBDA_FUNCTION_VERSION
  • AWS_LAMBDA_INITIALIZATION_TYPE
  • AWS_LAMBDA_LOG_GROUP_NAME
  • AWS_LAMBDA_LOG_STREAM_NAME
  • AWS_LAMBDA_RUNTIME_API
  • AWS_XRAY_CONTEXT_MISSING
  • AWS_XRAY_DAEMON_ADDRESS
  • LAMBDA_RUNTIME_DIR
  • LAMBDA_TASK_ROOT
  • _AWS_XRAY_DAEMON_ADDRESS
  • _AWS_XRAY_DAEMON_PORT
  • _HANDLER
  • _LAMBDA_TELEMETRY_LOG_FD
Last updated on July 16, 2024