Nicole Staline
Nicole Staline

Reputation: 671

Cannot update `max_wal_senders` parameter, always set to 1

I'm trying to increase the max_wal_senders param and no matter how or what I set it to, it always shows up as 1.

Updated postgresql.conf, only one instanced of max_wal_senders and it's set to 10.

I've also used alter system set max_wal_senders = 10 and verified it's showing as 10 in the auto.conf.

I've restarted the DB multiple times, and updating other config changes like max_connections are showing as updated when looking at show max_connections so I know the config I'm updating is the correct one.

In running select * from pg_settings where name = 'max_wal_senders';

Current value is 1, boot_value is set to 10, and the reset_value is set to 1.

It seems like it's getting reset or the changes just aren't being applied for some reason, but not having the issue with any other parameter. Anything I'm missing?

Should also be noted that I'm running Postgres though docker and my method for restarting postgres is simply restarting the docker container. (again, this works for other config changes, so not sure if it matters)

{
"select * from pg_settings where name = 'max_wal_senders'": [
    {
        "name" : "max_wal_senders",
        "setting" : "1",
        "unit" : null,
        "category" : "Replication \/ Sending Servers",
        "short_desc" : "Sets the maximum number of simultaneously running WAL sender processes.",
        "extra_desc" : null,
        "context" : "postmaster",
        "vartype" : "integer",
        "source" : "command line",
        "min_val" : "0",
        "max_val" : "262143",
        "enumvals" : null,
        "boot_val" : "10",
        "reset_val" : "1",
        "sourcefile" : null,
        "sourceline" : null,
        "pending_restart" : false
    }
]}

In checking my docker-compose.yml, in the postgres command I'm setting cmax_wal_senders=1.

postgres -cwal_level=archive -carchive_mode=on -carchive_command="/usr/bin/wget wale/wal-push/%f -O -" -carchive_timeout=600 -ccheckpoint_timeout=700 -cmax_wal_senders=1

I've updated this to 10 though and have restarted the container and am still seeing 1.

postgres -cwal_level=archive -carchive_mode=on -carchive_command="/usr/bin/wget wale/wal-push/%f -O -" -carchive_timeout=600 -ccheckpoint_timeout=700 -cmax_wal_senders=10

Upvotes: 1

Views: 2968

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 246073

The explanation can be seen in the output from pg_settings: the source of the setting is "command line". That means that the server was started with that explicit parameter value, e.g.

postgres -c max_wal_senders=1 -D datadir

That will override the setting in the configuration files.

Upvotes: 2

Related Questions