We are going to run Hot-Standby Replication for our environment.
In this YouTube link at 24:54, it was mentioned that, to run READ-ONLY queries in Hot-Standby we must increase max_worker_processes
config.
So that I read the documentations.
Now my questions are
what does "worker" means? I think that, it is any process that started with PostgreSQL, even it is autovacuum or any process that runs by any installed extention. Isn't it?
While a Hot-Standby added, how should I change the "max_worker_processes"?
-
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.Community– Community Bot2023年08月13日 10:23:25 +00:00Commented Aug 13, 2023 at 10:23
1 Answer 1
what does "worker" means? I think that, it is any process that started with PostgreSQL, even it is autovacuum or any process that runs by any installed extention. Isn't it?
max_worker_processes
means Background Worker Processes and only them. They are meaningful for max_parallel_workers
, max_parallel_maintenance_workers
, max_parallel_workers_per_gather
and for logical replication. Some extensions may also use this infrastructure and therefore require a certain number of max_worker_processes
- this is usually written in the extension installation documentation.
While a Hot-Standby added, how should I change the "max_worker_processes"?
These parameters should be set on the standbys to values equal to or greater than on the primary to apply physical replication:
- max_connections
- max_prepared_transactions
- max_locks_per_transaction
- max_wal_senders
- max_worker_processes
Without this, replication will stop. (with the entire standby database on older versions)
Hot standby does not require max_worker_processes
to be increased. But if you increased it on the primary, then on all standbys this setting should not be lower.
-
Thank you. I want to know in which state or situation its needed to increase the
max_worker_processes
?Mofarah– Mofarah2023年08月13日 15:36:57 +00:00Commented Aug 13, 2023 at 15:36 -
@Mofarah It must be as large on the replica as it is on the primary (or larger). If it is not that large then it needs to be increased. You seem to be reading more into this than there is.jjanes– jjanes2023年08月13日 18:53:03 +00:00Commented Aug 13, 2023 at 18:53
Explore related questions
See similar questions with these tags.