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

From: Konstantin Malanchev <hombit(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(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 13:31:39
Message-ID: 1D244A41-F688-4C6A-A9E7-436BC9DB1343@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> I think it could fail that way for two reasons: /dev/shm size limit
> (mount option, which I think you are saying you have set to 4GB?), or
> your system ran out of RAM +swap.

df /dev/shm
Filesystem 1K-blocks Used Available Use% Mounted on
shm 4194304 351176 3843128 9% /dev/shm

mount | grep /dev/shm
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=4194304k)

I have no swap and 8GB of RAM, when there is no active queries only ~800MB of RAM is used. So I don't believe that it is out of memory problem.

> The directly listing in your first
> message only shows 1.4GB, not 4GB, so perhaps it's the second problem.

I cannot catch the right moment with ls, but I've run bash for-loop that that logs "df /dev/shm" every minute and the last entry before fail shows that 89% of /dev/shm is used:

Filesystem 1K-blocks Used Available Use% Mounted on
shm 4194304 3732368 461936 89% /dev/shm

There is no other processes that use /dev/shm.

> It's strange that it's hashing the ~20B row table instead of the ~30M row table.

It could be a question for another mail thread =)

Konstantin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dave Hughes 2019-07-09 13:50:57 Re: SuperUser permission denied when creating table.
Previous Message Ron 2019-07-09 13:28:57 Re: pg_dump and search_path