Connection pooling vs read replicas for a 50k-member forum
We used to raise max_connections whenever p99 login latency spiked. After about 4_000 concurrent sessions that stopped working — the wait moved to row locks on topic_subscriptions.
What we measured
- sqlx pool wait (target under 8ms).
- PostgreSQL
wait_eventforLockvsIO. - Valkey session GET p99, which stayed flat.
Feed SELECTs now hit a replica. Votes still go to primary. If you have run a forum past 50k DAU, how did you split read-your-writes from the home feed?

We hit the same wall on
connection. Replica lag was the surprise, not CPU.