Anyways, I'm probably wrong here but it looks like I'm about to figure this out now :D
159 karma · joined August 1, 2007
Anyways, I'm probably wrong here but it looks like I'm about to figure this out now :D
Might be a little too close to "supervisor" though.
> To what extent are these metrics distorted by use of a Supavisor connection pooler? How could Supavisor compensate for that?
You mean if you have an Elixir app and using Supavisor for connection pooling? They would be affected as much as they would be if you used PgBouncer.
For the metrics Supavisor is exposing, it has those Ecto metrics for the interactions with the management database.
Supavisor doesn't use any libs for handling the wire protocol. It handles the wire protocol directly. We are exposing some similar ones: https://github.com/supabase/supavisor/wiki/Metrics
If you're using Elixir there's really no need for separate connection pool until you have LOTS of nodes.
Maybe binary_parameters is a different thing. Need to look into it more but this is a good one to add to the docs. And maybe officially support named prepared statements natively if lots of clients don't support unnamed prepared statements but definitely seems like we'd have to do much more accounting.
Naively, POSTing a query string and params would go a long ways I think.
e.g. https://blog.bullgare.com/2019/06/pgbouncer-and-prepared-sta...
Elixir's Ecto can (and that Go example) so if you use Elixir (or Go) you can use prepared statements with PgBouncer (or Supavisor!) in transaction mode.
We made sure to do local benchmarks along the way and there wasn't a meaningful difference.
Really the discussion was around doing as little message passing as possible to not copy data.
See:
https://github.com/supabase/supavisor/pull/4
https://github.com/supabase/supavisor/issues/7
So there are definite gains there but if we want to do things across a cluster we're going to be copying data. The decision at the time was the benefits of clustering outweighed the perf gains considering we were basically already as fast as PgBouncer. This could change.
If you are interested in connecting over this it would be great to connect… chase@supabase.com.
We want to do load balancing too. Makes so much sense to do load balancing in the proxy.
PgBouncer was on the same instance I’m assuming?
Erlang process monitoring makes it very easy to handle client disconnects.
And Elixir makes using Erlang a bit more approachable.
An interesting bit... the syn library helps us guarantee there is only one connection pool alive on the cluster at a time and gives us callbacks to resolve the conflict if two get spun up.
If no connection exists yet, you're right, two connections could try to establish themselves at the same time. In which case, whoever gets to the db first wins. But then the loser is still connected to PubSub, so they'll now start getting changes just the same.
- 25 concurrent channels
- 25 channel joins per second
- 200 concurrent connections
- 100 broadcast messages per second avg over 60 seconds (not including db changes) (aka 6,000 per minute rolling)
I think these are probably pretty close to where we'll land for free projects. They can be changed per project so if you (or anyone) needs a limit increased in the short term we can do that.
https://elixir-lang.org/blog/2021/01/13/orchestrating-comput...
I built Logflare so you could get your structured logs into BigQuery directly, so now you this :)
Hopefully we'll have a Vector sink soon, but until then I think they support POSTing batches to HTTP endpoints so you can do that and we'll take any JSON and go straight to BQ with it after migrating your schema for you (automatically based on the incoming payload shape).
"Our tracing pipeline has been in production for over a year now and we trace 1% of all requests from our clients. For some low volume services, we trace 100%. Our current pipeline processes ~310M traces/day and about ~8.5B spans per day, producing around 2Tb of trace data every day."
Only if you're using Elastic.