Skip to content

pgflow-dev/pool-exhaustion-repro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

Pool Exhaustion Repro

This is a reproduction of the pool exhaustion problem with Edge Worker.

Local Testing

Setup

  1. Clone the repo
  2. Start Supabase npx [email protected] start This will create test_seq, tasks queue and will send 100k messages
  3. Start Edge Runtime npx [email protected] functions serve
  4. Start Edge Worker curl http://localhost:54321/functions/v1/worker Processing should immediately start

Observe

Worker fails around 32-37k messages.

Check pooler logs with docker logs supabase_pooler-pool-exhaustion-repro

Cloud Testing

  1. Clone the repo

  2. Link a remote project npx [email protected] link

  3. Reset remote db npx [email protected] db reset --linked

  4. Set EDGE_WORKER_DB_URL in Dashboard (Edge Functions > Secrets)

    Make sure to use Transaction Mode URL!

  5. Deploy worker npx [email protected] functions deploy

  6. Start worker

    • replace <project_ref> with your project ref
    curl --request POST 'https://<project_ref>.supabase.co/functions/v1/worker' --header 'Content-Type: application/json'

    (function is set to not verify JWT tokens, no need to supply ANON_KEY)

Observe

Check logs in dashboard

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published