Обсуждение: Hot standby and xlog on a ramdisk

Поиск
Список
Период
Сортировка

Hot standby and xlog on a ramdisk

От
Tore Halvorsen
Дата:
Hi,

Can a hot standby run correctly with the xlog-files on a ramdisk?

--
Eld på åren og sol på eng gjer mannen fegen og fjåg. [Jøtul]
<demo> Tore Halvorsen || +052 0553034554

Re: Hot standby and xlog on a ramdisk

От
Scott R Mead
Дата:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256



On 02/04/2016 09:15 AM, Tore Halvorsen wrote:
> Hi,
>
> Can a hot standby run correctly with the xlog-files on a ramdisk?
>

Yes, but, if you lose any, you'll need to rebuild the standby.


> -- Eld på åren og sol på eng gjer mannen fegen og fjåg. [Jøtul]
> <demo> Tore Halvorsen || +052 0553034554

- --
Scott Mead
OpenSCG <http://www.openscg.com>
http://www.openscg.com
PostgreSQL, Java & Linux Experts
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJWs13RAAoJEMpZLrKS7LGMa9IH/3BE05zIriu1x2zw4FwCMlCc
22aiV1G4Qt2rgnVakV10Cad/hZ6nL9xRnZx+wcAGN3kN3SQJfTL71rL/e2kXzr8J
OWIrspLmCjpnRlO0tPkOYtf7nCsWMo2B4iyqbvZSUuK8vyWnp5DXwdqBZcDmhQGq
r3rccwB1ZCsn5WMato182bU90m6pKRegr11RUKjwHKpM6AfW05WDqZwK3m7DRtAZ
g9JE3B/lcdFzTINo5rpQpABy7ONGs92/E9GvrewAFgU22SKy1LZl0KuPHnohgQGb
5H+zoBzdh3fI10+tNKQMmshJg2XyZMw7YFahdugaJVsUs2hFDTfVVdYUNvlVmaQ=
=cryn
-----END PGP SIGNATURE-----


Re: Hot standby and xlog on a ramdisk

От
Tore Halvorsen
Дата:
On 02/04/2016 09:15 AM, Tore Halvorsen wrote:
> Can a hot standby run correctly with the xlog-files on a ramdisk?
>

Yes, but, if you lose any, you'll need to rebuild the standby.


Even if the master and archive contain all the wal files?

 
--
Eld på åren og sol på eng gjer mannen fegen og fjåg. [Jøtul]
<demo> Tore Halvorsen || +052 0553034554

Re: Hot standby and xlog on a ramdisk

От
Scott R Mead
Дата:

On 02/04/2016 09:25 AM, Tore Halvorsen wrote:
On 02/04/2016 09:15 AM, Tore Halvorsen wrote:
> Can a hot standby run correctly with the xlog-files on a ramdisk?
>

Yes, but, if you lose any, you'll need to rebuild the standby.


Even if the master and archive contain all the wal files?

If you have the file somewhere, you're okay, whether it's on the master, standby or an archive host.  If you're using log-shipping, you'll need all the WALs.
--
Eld på åren og sol på eng gjer mannen fegen og fjåg. [Jøtul]
<demo> Tore Halvorsen || +052 0553034554

--
Scott Mead
OpenSCG
http://www.openscg.com
PostgreSQL, Java & Linux Experts

Re: Hot standby and xlog on a ramdisk

От
Tore Halvorsen
Дата:


On Thu, Feb 4, 2016 at 3:30 PM, Scott R Mead <scottm@openscg.com> wrote:
> Can a hot standby run correctly with the xlog-files on a ramdisk?
>

Yes, but, if you lose any, you'll need to rebuild the standby.


Even if the master and archive contain all the wal files?

If you have the file somewhere, you're okay, whether it's on the master, standby or an archive host.  If you're using log-shipping, you'll need all the WALs.

So, just to verify my understanding. Using a ramdisk for pg_xlog on a hot standby slave should be ok in all cases as long as the archive and master retains all wal files that are not applied?

I maintain a fairly active database (>100GB of wal files every day) and putting the wal files on a ramdisk (only for the slaves of course) helped quite a lot.


--
Eld på åren og sol på eng gjer mannen fegen og fjåg. [Jøtul]
<demo> Tore Halvorsen || +052 0553034554

Re: Hot standby and xlog on a ramdisk

От
David Steele
Дата:
On 2/4/16 9:46 AM, Tore Halvorsen wrote:
> On Thu, Feb 4, 2016 at 3:30 PM, Scott R Mead <scottm@openscg.com
> <mailto:scottm@openscg.com>> wrote:
>
>>         > Can a hot standby run correctly with the xlog-files on a
>>         ramdisk?
>>         >
>>
>>         Yes, but, if you lose any, you'll need to rebuild the standby.
>>
>>
>>     Even if the master and archive contain all the wal files?
>>
>     If you have the file somewhere, you're okay, whether it's on the
>     master, standby or an archive host.  If you're using log-shipping,
>     you'll need all the WALs.
>
>
> So, just to verify my understanding. Using a ramdisk for pg_xlog on a
> hot standby slave should be ok in all cases as long as the archive and
> master retains all wal files that are not applied?

Yes.  If the pg_xlog ramdisk is lost on the standby then Postgres will
start throwing errors but there will be no corruption of the heap.  It's
possible that Postgres will terminate at this point, but after
remounting the ramdisk you can restart Postgres on the standby and
everything will be fine.

If something goes really horribly wrong you can always rebuild the standby.

--
-David
david@pgmasters.net


Вложения