cpursley / walex

Postgres change events (CDC) in Elixir
MIT License
276 stars 14 forks source link

[ask] how to determine max_wal_senders #51

Open OctopusRage opened 6 months ago

OctopusRage commented 6 months ago

im getting error [25360]:FATAL: number of requested standby connections exceeds max_wal_senders (currently 25) while replicating my production db my db currently on RDS and have 2 slave how to determin max_wal_senders to avoid getting this error?

cpursley commented 6 months ago

We need to add this as a config setting. I'll take a look int it next week (unless you'd like to submit a PR before then).

cpursley commented 6 months ago

https://hexdocs.pm/postgrex/Postgrex.ReplicationConnection.html#module-logical-replication

I think this might just be a database setting, I'll dive in deeper next week.

OctopusRage commented 6 months ago

aight thx, i got a hunch my connection restarting somewhere in the middle.. gotta monitor next try using pg_stat_replication

OctopusRage commented 6 months ago

running query below

select application_name, sent_lsn, write_lsn, state, backend_start from pg_stat_replication where usename = 'myapprepluser'

resulting this, why some states starting up and keep idle all the time?

image