Skip to content

Updated

Edge Functions limits

Look up the limits and restrictions that apply to Edge Functions on Supabase's hosted platform. Check this page when any of the following happens:

  • A function returns 546 because it exceeded a resource limit (WORKER_RESOURCE_LIMIT)
  • A function returns 504 Gateway Timeout because it didn't respond within the request idle timeout
  • A function or its background task shuts down when it reaches the wall clock, CPU, or memory limit

Runtime limits

The following table lists the limits on each Edge Function worker and request.

LimitValueDetails
Maximum memory256MB
Maximum duration (wall clock limit)Free Plan: 150s, Pro Plan and above: 400sThe duration an Edge Function worker stays active. During this period, a worker can serve multiple requests or process background tasks.
Maximum CPU time2sThe amount of actual time spent on the CPU per worker. Doesn't include async I/O.
Request idle timeout150sIf an Edge Function doesn't send a response before the timeout, it returns 504 Gateway Timeout.

Platform limits

The following table lists the limits on functions and logs in each project.

LimitValue
Maximum function size20MB bundled locally with the CLI, or 5MB bundled server-side, such as with the Management API or Dashboard
Maximum number of functions per projectFree: 100, Pro: 1000, Team: 2000, Enterprise: Unlimited
Maximum log message length10,000 characters
Log event threshold100 events per 10 seconds
Recursive or nested function calls30 requests per trace, within a 60-second window

Secrets

The following table lists the limits on secrets in each project.

LimitValue
Maximum number of secrets per project100
Secret name lengthUp to 256 characters
Maximum secret size48 KiB (24,576 characters)
Reserved name prefixSUPABASE_. Names must not start with this prefix.

Other limits & restrictions

The following restrictions apply to all Edge Functions:

  • Outgoing connections to ports 25 and 587 are not allowed.
  • Serving of HTML content is only supported with custom domains (Otherwise GET requests that return text/html will be rewritten to text/plain).
  • Web Worker API (or Node vm API) are not available.
  • Static files cannot be deployed using the API flag. You need to build them with Docker on the CLI.
  • Node Libraries that require multithreading are not supported. Examples: libvips, sharp.

To work within these limits, see the following pages: