1

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

  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?

  2. While a Hot-Standby added, how should I change the "max_worker_processes"?

asked Aug 13, 2023 at 8:24
1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Commented Aug 13, 2023 at 10:23

1 Answer 1

0

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.

answered Aug 13, 2023 at 15:04
2
  • Thank you. I want to know in which state or situation its needed to increase the max_worker_processes? Commented 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. Commented Aug 13, 2023 at 18:53

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.