Vercel Functions Limits

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

FeatureNode.js
Maximum memoryHobby: 2 GB, Pro and Ent: 4 GB
Maximum durationHobby: 300s (default) - configurable up to 300s, Pro: 300s (default) - configurable up to 800s, Ent: 300s (default) - configurable up to 800s. 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
File descriptors1,024 shared across concurrent executions (including runtime usage)

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.

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

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.

With fluid compute enabled, Vercel Functions have the following defaults and maximum limits (applies to the Node.js and Python runtimes):

DefaultMaximum
Hobby300s300s
Pro300s800s
Enterprise300s800s
Have an existing project not yet using Fluid compute?

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

DefaultMaximum
Hobby10s60s
Pro15s300s
Enterprise15s900s

Vercel Functions have the following defaults and maximum limits:

DefaultMaximum
Hobby2 GB / 1 vCPU2 GB / 1 vCPU
Pro /Enterprise2 GB / 1 vCPU4 GB / 2 vCPU

Users on Pro and Enterprise plans can configure the default memory size for all functions in the dashboard.

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.

File descriptors are unique identifiers that the operating system uses to track and manage open resources like files, network connections, and I/O streams. Think of them as handles or references that your application uses to interact with these resources. Each time your code opens a file, establishes a network connection, or creates a socket, the system assigns a file descriptor to track that resource.

Vercel Functions have a limit of 1,024 file descriptors shared across all concurrent executions. This limit includes file descriptors used by the runtime itself, so the actual number available to your application code will be strictly less than 1,024.

File descriptors are used for:

  • Open files
  • Network connections (TCP sockets, HTTP requests)
  • Database connections
  • File system operations

If your function exceeds this limit, you might encounter errors related to "too many open files" or similar resource exhaustion issues.

To manage file descriptors effectively, consider the following:

  • Close files, database connections, and HTTP connections when they're no longer needed
  • Use connection pooling for database connections
  • Implement proper resource cleanup in your function code
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 the amount of CPU time your code consumes. Waiting for I/O (e.g. calling AI models, database queries) does not count towards your Function duration.

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 May 30, 2025