You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a copy of a troubleshooting article on Supabase's docs site. It may be missing some details from the original. View the original article.
When running Supabase locally with the CLI, the Kong API gateway can stop
responding under heavy load. This typically happens when many parallel
requests are made (for example, bulk operations against the Storage API):
Kong starts terminating socket connections and logs errors about not having
enough available workers.
Why this happens
To keep the local stack lightweight, the CLI starts Kong with a single nginx
worker process (KONG_NGINX_WORKER_PROCESSES=1). A single worker minimizes
memory usage across the ~12 containers that make up the local stack, but it
also limits how many concurrent connections Kong can handle. When the number
of in-flight requests exceeds what one worker can serve, Kong becomes
unresponsive and drops connections.
How to fix it
You can override the number of Kong nginx worker processes by setting the KONG_NGINX_WORKER_PROCESSES environment variable before starting the local
stack. Set it to a specific number, or to auto to let Kong allocate one
worker per available CPU:
# Use one worker per CPU core
KONG_NGINX_WORKER_PROCESSES=auto supabase start
# Or pick a fixed number of workers
KONG_NGINX_WORKER_PROCESSES=2 supabase start
You can also export the variable so it applies to every command in your shell
session:
Increasing the worker count lets Kong handle more parallel connections at the
cost of higher memory usage. If you don't set the variable, the CLI keeps the
default of 1 worker to minimize the local stack's memory footprint.
After changing the value, restart the stack for it to take effect:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
This is a copy of a troubleshooting article on Supabase's docs site. It may be missing some details from the original. View the original article.
When running Supabase locally with the CLI, the Kong API gateway can stop
responding under heavy load. This typically happens when many parallel
requests are made (for example, bulk operations against the Storage API):
Kong starts terminating socket connections and logs errors about not having
enough available workers.
Why this happens
To keep the local stack lightweight, the CLI starts Kong with a single nginx
worker process (
KONG_NGINX_WORKER_PROCESSES=1). A single worker minimizesmemory usage across the ~12 containers that make up the local stack, but it
also limits how many concurrent connections Kong can handle. When the number
of in-flight requests exceeds what one worker can serve, Kong becomes
unresponsive and drops connections.
How to fix it
You can override the number of Kong nginx worker processes by setting the
KONG_NGINX_WORKER_PROCESSESenvironment variable before starting the localstack. Set it to a specific number, or to
autoto let Kong allocate oneworker per available CPU:
You can also export the variable so it applies to every command in your shell
session:
export KONG_NGINX_WORKER_PROCESSES=auto supabase startIncreasing the worker count lets Kong handle more parallel connections at the
cost of higher memory usage. If you don't set the variable, the CLI keeps the
default of
1worker to minimize the local stack's memory footprint.After changing the value, restart the stack for it to take effect:
Additional resources
All reactions