0

AWS RDS Postgresql 12.10

According to https://www.enterprisedb.com/postgres-tutorials/comprehensive-guide-how-tune-database-parameters-and-configuration-postgresql,

max_worker_processes Set this to the number of CPUs you want to share for PostgreSQL exclusively. This is the number of background processes the database engine can use. Setting this parameter will require a server restart. The default is 8.

The default is also 8 in AWS RDS Postgresql, no matter the Instance type (and thus number of vCPUs). Am I cheating myself by paying for a db.r5.12xlarge (48 CPUs) while using the default max_worker_processes value?

1
  • 1
    On v13, the RDS default is GREATEST(${DBInstanceVCPU*2},8)
    – jjanes
    Jul 31, 2022 at 0:27

1 Answer 1

1

If you depend on large scale parallel query from just a few concurrent sessions to get your work done, then surely you have been cheating yourself. But if you don't, then probably not. For example, if you have a large number of simultaneous connections all submitting CPU intensive queries at the same time, you will probably be able to keep all 24 CPUs busy without any parallelization. ("virtual" CPUs doesn't mean much, for r5.12xlarge more than 24 CPU-intensive jobs running at the same time will start competing with each other for processing time, regardless of the number of "vCPU" that are claimed)

3
  • 1
    Your answer seems to say that max_worker_processes is per-connection, but the EDB link says "This is the number of background processes the database engine can use." ISTM that is a system-wide number, not per-connection. What am I missing?
    – RonJohn
    Jul 31, 2022 at 16:32
  • 1
    @RonJohn, sorry, I don't understand what part of my answer you read that way. Connections always get at least one process, regardless of max_worker_processes. It is only additional workers (parallel workers) that are restricted.
    – jjanes
    Jul 31, 2022 at 21:48
  • It's not your answer, it's the EDB document.
    – RonJohn
    Jul 31, 2022 at 22:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.