Re: PGSQL 11.4: shared_buffers and /dev/shm size

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Konstantin Malanchev <hombit(at)gmail(dot)com>
Cc: Jean Louis <bugs(at)gnu(dot)support>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: PGSQL 11.4: shared_buffers and /dev/shm size
Date: 2019-07-09 11:54:40
Message-ID: CA+hUKGJJPpOcCX946DEFr+uTf4KO22k=ppBL=9BHi=CyL_=unQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jul 9, 2019 at 11:11 PM Konstantin Malanchev <hombit(at)gmail(dot)com> wrote:
> Thank you for explanation. work_mem = 512MB and max_parallel_workers_per_gather = 2 and I run only one Postgres instance and only one query. EXPLAIN shows "Workers Planned: 2" for this query. Why it can use more than 1GB of /dev/shm?

For example, if you have one Parallel Hash Join in your plan, it could
allocate up to 512MB * 3 of shared memory (3 = leader process + 2
workers). It sounds like you'll need to set work_mem smaller. If you
run EXPLAIN ANALYZE you'll see how much memory is used by individual
operations. Usually it's regular private anonymous memory, but for
Parallel Hash it's /dev/shm memory.

--
Thomas Munro
https://enterprisedb.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Konstantin Malanchev 2019-07-09 12:27:56 Re: PGSQL 11.4: shared_buffers and /dev/shm size
Previous Message Konstantin Malanchev 2019-07-09 11:11:50 Re: PGSQL 11.4: shared_buffers and /dev/shm size