Settings

Theme

Postgres Postmaster does not scale

recall.ai

33 points by davidgu 12 hours ago · 7 comments

Reader

atherton94027 5 minutes ago

I'm a bit confused here, do they have a single database they're writing to? Wouldn't it be easier and more reliable to shard the data per customer?

levkk 9 minutes ago

One of the many problems PgDog will solve for you!

  • eatonphil 4 minutes ago

    The article addresses this, sort of. I don't understand how you can run multiple postmasters.

    > Most online resources chalk this up to connection churn, citing fork rates and the pid-per-backend yada, yada. This is all true but in my opinion misses the forest from the trees. The real bottleneck is the single-threaded main loop in the postmaster. Every operation requiring postmaster involvement is pulling from a fixed pool, the size of a single CPU core. A rudimentary experiment shows that we can linearly increase connection throughput by adding additional postmasters on the same host.

vivzkestrel 10 minutes ago

very stupid question: similar to how we had a GIL replacement in python, cant we replace postmaster with something better?

vel0city 34 minutes ago

Isn't this kind of the reason why teams will tend to put database proxies in front of their postgres instances, to handle massive sudden influxes of potentially short lived connections?

This sounds exactly like the problem tools like pgbouncer were designed to solve. If you're on AWS one could look at RDS Proxy.

  • evanelias 19 minutes ago

    Also check out ProxySQL [1][2], it's an extremely powerful and battle-tested proxy. Originally it was only for MySQL/MariaDB, where it is very widely used at scale, even despite MySQL already having excellent built-in scalable threaded connection management. But ProxySQL also added Postgres support too in 2024 and that has become a major focus.

    [1] https://proxysql.com/

    [2] https://github.com/sysown/proxysql

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection