0

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
Nicole Staline
  • 557
  • 4
  • 15

1 Answers1

1

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.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
  • Can this not be changed once the server is started with the value though? I updated the docker-compose command to set max_wal_senders=10 and restarted the container, but I'm guessing the 1 value is still stored on a volume somewhere. I would have figured `alter system` would be a way to adjust this. – Nicole Staline Jul 06 '22 at 19:57
  • No, this cannot be changed once the server has started. You'll have to modify the way PostgreSQL is started. – Laurenz Albe Jul 07 '22 at 06:00