# Edge Function limits

> Memory, response time, size and count limits for Edge Functions on SupaHost, the container memory per plan, and how to work within them.

Source: https://supahost.app/docs/functions/limits · Updated 2026-11-11

These are the limits that apply to Edge Functions on SupaHost. They're set per worker, per function or per project, and they're the same on every plan except the shared container memory.

There's no limit on the number of invocations and no per-invocation charge. Responses count toward your instance's monthly egress like any other API traffic.

## Runtime limits

| Limit | Value | What happens when you hit it |
|---|---|---|
| Memory per worker | 150 MB | The request fails with `546 WORKER_RESOURCE_LIMIT` (the router retries up to 2 times first). |
| Time to start responding | 150 seconds | The request fails with `504 IDLE_TIMEOUT`. |
| Worker wall-clock lifetime | 400 seconds | The worker is stopped. |
| Functions container memory | Builder 384 MB, Pro 768 MB, Business 1536 MB, Enterprise 3 GB | Shared by all of one project's functions running at the same time. |

The 150-second rule is about the *first* byte of the response. A function that streams its answer (for example, tokens from an AI model) keeps the connection alive as long as it sends data, up to the worker's wall-clock lifetime.

## Size and count limits

| Limit | Value |
|---|---|
| Functions per project | 100 |
| Files per function | 50 |
| Total source per function | 1 MB |
| Folder depth | 8 levels (for example `a/b/c/d/e/f/g/h.ts`) |
| Function name | 1–63 characters: lowercase letters, numbers, `-`, `_`, starting with a letter or number |
| Secrets per project | 100, each up to 10,000 characters |
| Secret names | Letters, numbers and `_`, not starting with a number, up to 100 characters; `SUPABASE_` prefix reserved |

The 1 MB limit counts your own files only. Packages you import with `npm:`, `jsr:` or `https:` are downloaded at deploy time and don't count, so import big libraries instead of pasting them in.

## Dashboard testing limits

The **Test a function** card waits up to 60 seconds for a response and shows at most the first 64 KB of the body. Those limits apply to the tester only, not to real callers.

## Working within the limits

**Memory.** Stream large files instead of reading them into memory:

```ts
Deno.serve(async () => {
  const upstream = await fetch("https://exports.example.com/invoices-2026.csv");
  // Pass the body through without buffering it.
  return new Response(upstream.body, {
    headers: { "Content-Type": "text/csv", "Content-Disposition": "attachment; filename=invoices-2026.csv" },
  });
});
```

Process big datasets in pages (the Data API returns at most 1000 rows per request anyway) rather than loading everything at once.

**Long jobs.** If work takes minutes, don't make the caller wait. Accept the request, put the work on a queue, and answer straight away; a scheduled consumer then works through the queue in batches that each finish well inside the limits. See [Queues with pgmq](/docs/cron-queues/queues) and [Processing queue messages](/docs/cron-queues/queue-consumers).

**Many functions.** If you're nearing 100 functions, group related endpoints into one function with internal routing (see [Writing functions](/docs/functions/writing-functions)).

**Concurrency.** All functions in a project share the container memory for your plan. A Builder project running two memory-hungry functions at once has less headroom than a Pro project. Watch `shutdown` lines in the logs, which report memory used per worker.

## Things functions can't do on SupaHost

- Connect directly to Postgres: there's no `SUPABASE_DB_URL`. Use supabase-js; see [Using the database from a function](/docs/functions/database-access).
- Be deployed with `supabase functions deploy`: see [Deploying functions](/docs/functions/deploying).

For outbound IP addresses and WebSockets, see [Static outbound IP for Edge Functions](/kb/static-egress-ip) and [WebSockets in Edge Functions](/kb/function-websockets).

## Related

- [Logs and debugging](/docs/functions/logs)
- [Edge Function memory limit or worker limit errors](/kb/function-memory-limit)
- [Edge Function takes too long or times out](/kb/function-timeout)
- [Limits reference](/docs/platform/limits)
