{"by":"kiwicopple","descendants":49,"id":35501718,"kids":[35507875,35502285,35502158,35502113,35512570,35507840,35508467,35506930,35501972,35514589,35510363,35501924,35507608,35501733,35508611],"score":149,"text":"hey hn, supabase ceo here<p>this is a postgres connection pooler. it’s similar to pgbouncer, but built with Elixir and specifically designed for multi-tenancy.<p>it’s still under development, but it’s at a stage where we can gather a feedback from the community and you can try it yourself. we aren’t using this in production yet, but aiming to deploy it for a subset of databases in the next 2 months.<p>We have the following benchmarks (details in the readme):<p><pre><code>  - Elixir Cluster maintaining 400 connections to a single Postgres database\n  - 1_000_000 clients connecting to the Elixir cluster\n  - Sending 20_000 transactions per second\n  - Consuming 7.8G RAM and ~50% CPU on a 64vCPU machine\n</code></pre>\nsupavisor can be run as a cluster or a single node&#x2F;binary.  It’s handling 90%+ of the throughput of pgbouncer on a local machine (running pgbench)<p>we will place this in front of all supabase databases. It will eventually be able to handle multiple types of connections: traditional TCP connections, and HTTP connections for developers who are connecting to Postgres in serverless environments using Prisma, Kysely, Drizzle, etc<p>the proxy will serve as a connection buffer while we scale databases: scaling up compute with zero-downtime, and for scale-to-zero - triggering a server restart when a connection is initiated<p>finally, i want to shout out to Jose and the Dashbit&#x2F;elixir team. They were extremely helpful with the design &amp; architecture. they have been valuable partners, and elixir continues to be an amazing language for tools like this and our Realtime server.","time":1681039765,"title":"Show HN: Supavisor – a Postgres connection pooler written in Elixir","type":"story","url":"https://github.com/supabase/supavisor"}