Re: Stalls on PGSemaphoreLock

From: Matheus de Oliveira <matioli(dot)matheus(at)gmail(dot)com>
To: Matthew Spilich <mspilich(at)tripadvisor(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Stalls on PGSemaphoreLock
Date: 2014-04-22 15:48:25
Message-ID: CAJghg4+gc6MEGwvsnJuKGbDSJ06kO=Vb4r70qi8WekqkgkT4Kw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Apr 22, 2014 at 12:12 PM, Matthew Spilich
<mspilich(at)tripadvisor(dot)com>wrote:

> Hi all - I am a little delayed in reporting back on this issue, but it
> was indeed the hugepage defrag setting that was the cause of my issue.
>

The transparent huge pages features seems so bogus for database workloads,
that it is one of the first things I disable on new servers (I have tried
to let it enabled sometimes, but every time the system was better with it
disabled).

> One item that we noticed as we were testing this issue that I wanted to
> report back to the forum is that these settings
> ...
> Were not sicky on reboot for my version of CentOS, which probably explains
> why I thought this was disabled already only to have it crop back up.
> Anyway, I wanted to report back these findings to close the loop on this
> and to thank the community again for their support.
>

Just changing files at /sys/ is not permanent, so I recommend adding these
commands into your /etc/rc.local file:

test -f /sys/kernel/mm/transparent_hugepage/enabled && echo never >
/sys/kernel/mm/transparent_hugepage/enabled
test -f /sys/kernel/mm/transparent_hugepage/defrag && echo never >
/sys/kernel/mm/transparent_hugepage/defrag

The test's are just to make sure the file does exists, as its location
changes depending on the distro you are using and may also change on kernel
upgrades.

It is also possible to add transparent_hugepage=never on grub.conf file,
but I personally dislike this option.

Regards,
--
Matheus de Oliveira
Analista de Banco de Dados
Dextra Sistemas - MPS.Br nível F!
www.dextra.com.br/postgres

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jeff Janes 2014-04-22 15:58:56 Re: tsearch2, large data and indexes
Previous Message Matthew Spilich 2014-04-22 15:12:32 Re: Stalls on PGSemaphoreLock