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
546because it exceeded a resource limit (WORKER_RESOURCE_LIMIT) - A function returns
504 Gateway Timeoutbecause 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.
| Limit | Value | Details |
|---|---|---|
| Maximum memory | 256MB | |
| Maximum duration (wall clock limit) | Free Plan: 150s, Pro Plan and above: 400s | The duration an Edge Function worker stays active. During this period, a worker can serve multiple requests or process background tasks. |
| Maximum CPU time | 2s | The amount of actual time spent on the CPU per worker. Doesn't include async I/O. |
| Request idle timeout | 150s | If 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.
| Limit | Value |
|---|---|
| Maximum function size | 20MB bundled locally with the CLI, or 5MB bundled server-side, such as with the Management API or Dashboard |
| Maximum number of functions per project | Free: 100, Pro: 1000, Team: 2000, Enterprise: Unlimited |
| Maximum log message length | 10,000 characters |
| Log event threshold | 100 events per 10 seconds |
| Recursive or nested function calls | 30 requests per trace, within a 60-second window |
Secrets
The following table lists the limits on secrets in each project.
| Limit | Value |
|---|---|
| Maximum number of secrets per project | 100 |
| Secret name length | Up to 256 characters |
| Maximum secret size | 48 KiB (24,576 characters) |
| Reserved name prefix | SUPABASE_. Names must not start with this prefix. |
Other limits & restrictions
The following restrictions apply to all Edge Functions:
- Outgoing connections to ports
25and587are not allowed. - Serving of HTML content is only supported with custom domains (Otherwise
GETrequests that returntext/htmlwill be rewritten totext/plain). - Web Worker API (or Node
vmAPI) 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.
Related resources
To work within these limits, see the following pages:
- Edge Functions status codes: what a
504or546response means, and how to fix it. - Background tasks: mark background tasks, and how the wall clock, CPU, and memory limits cap them.
- Working around the secrets limit: bundle secrets into a JSON value when you need more than 100.