work_mem and maintenance_work_mem limits for managed postgres on Gen5 instance

Deniz Durmus 21 Reputation points
2021-09-24T01:01:08.17+00:00

There is a limit on work_mem and maintenance_work_mem parameters for server configurations, which is setting the max values to 2097171, although there is much larger amount memory available on the machine.

Why is there a limit on these configs?

Azure Database for PostgreSQL
0 comments No comments
{count} votes

Accepted answer
  1. Oury Ba-MSFT 20,931 Reputation points Microsoft Employee Moderator
    2021-09-24T21:57:27.347+00:00

    Hi @Deniz Durmus Thank you for posting your question on Microsoft Q&A.

    work_mem is assigned per connection so the total RAM used is work_mem * concurrent connectons – thus an upper limit is needed to avoid starving processes.
    Also maintenance_work_mem being a background process is designed to have a upper limit so that by mistake we do not over assign the memory and starve other processes.

    https://www.postgresql.org/docs/12/runtime-config-resource.html

    Hope that answer your question

    Regards,
    Oury


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.