Re: PostgreSQL NetApp and NFS

Lists: pgsql-performance
From: "Chris Hoover" <revoohc(at)gmail(dot)com>
To: "PGSQL Performance" <pgsql-performance(at)postgresql(dot)org>
Subject: PostgreSQL NetApp and NFS
Date: 2008-03-20 19:32:47
Message-ID: 1d219a6f0803201232g54924fb3ka206c9b03e4664c7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

I just found out that my company is planning on migrating my databases from
our current ISCSI storage solution to NetApps connected via NFS. I knew
about the NetApp migration, but always assumed (and shame on me) that I
would have direct attachments to the servers.

Well, I am very uncomfortable with the NFS attachement. I have been
searching the archives and see a lot of anocdotal stories of NFS horrors,
but so far, nothing but general stories and statements.

I need to know if anyone out there is/has run their PostgreSQL on NetApp
arrays via NFS. My particular situation is RH Linux 4 servers running
Postgresql 8.1. I need to provide our Operations manager with specific
reasons why we should not run PostgreSQL over NetApp NFS. Otherwise, they
will go forward with this.

If you have any real life good or bad stories, I'd love to hear it. Given
the NetApp arrays supposedly being very good NFS platforms, overall, is this
a recommended way to run PostgreSQL, or is it recommended to not run this
way.

Feel free to reply directly if you are not comfortable talking to this on
the list, but list replies would be preferred so others in my shoes can find
this information.

Thanks,

Chris
--
Come see how to SAVE money on fuel, decrease harmful emissions, and even
make MONEY. Visit http://colafuelguy.mybpi.com and join the revolution!


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Chris Hoover <revoohc(at)gmail(dot)com>
Cc: PGSQL Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: PostgreSQL NetApp and NFS
Date: 2008-03-20 20:09:39
Message-ID: 200803202009.m2KK9dc26453@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

Chris Hoover wrote:
> If you have any real life good or bad stories, I'd love to hear it. Given
> the NetApp arrays supposedly being very good NFS platforms, overall, is this
> a recommended way to run PostgreSQL, or is it recommended to not run this
> way.

We do have an NFS section in our documentation at the bottom of this
page:

http://www.postgresql.org/docs/8.3/static/creating-cluster.html

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: "Woody Woodring" <george(dot)woodring(at)iglass(dot)net>
To: "'Chris Hoover'" <revoohc(at)gmail(dot)com>, "'PGSQL Performance'" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: PostgreSQL NetApp and NFS
Date: 2008-03-20 20:45:14
Message-ID: 048001c88acb$4c2b27f0$80b1a8c0@istructure.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance


> I need to know if anyone out there is/has run their PostgreSQL on NetApp
arrays via NFS. My particular situation is RH Linux 4 servers running
Postgresql 8.1. I need
> to provide our Operations manager with specific reasons why we should not
run PostgreSQL over NetApp NFS. Otherwise, they will go forward with this.

> If you have any real life good or bad stories, I'd love to hear it.
Given the NetApp arrays supposedly being very good NFS platforms, overall,
is this a recommended way
> to run PostgreSQL, or is it recommended to not run this way.

We have been running Postgres over NFS to a NetApp since 7.1 and we have
nothing but good things to say. We have 75 databases in 3 clusters all
connected to one netapp. We don't store a huge amount of data, currently
~43Gig, but it is constantly updated.

We keep the pgsql/data directory on the netapp. If one of our db servers
ever have a problem, we can just swap out the box, mount the drive and
restart postgres.

We like our support we get from them, the only issue we ever have is having
a drives fail which they get replacements to us promptly. Our NetApp has an
uptime currently over 2 years.

By the way, I though NetApp boxes came with an iSCSI license. NetApp
downplayed the iSCSI with us because they said you cannot share drives
between servers, but for postgres you don't want that anyway. It could
have also been that the NetApp is better tuned for NFS throughput and they
want to steer the user toward that.

If you want more specifics, feel free to ask.

Woody
iGLASS Networks


From: "Frits Hoogland" <frits(dot)hoogland(at)gmail(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "Chris Hoover" <revoohc(at)gmail(dot)com>, "PGSQL Performance" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: PostgreSQL NetApp and NFS
Date: 2008-03-20 21:23:30
Message-ID: fbb8fbcd0803201423h27df25d5v5801f77f2a0e4031@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

My experience postgresql work good on NFS. Of course, use NFS over TCP, and
use noac if you want to protect your database even more (my experience is
NFS client caching doesn't lead to an irrecoverable database however)

I've encountered problems with RHEL4 as a database server and a client of a
Netapp filer, due to a bug in the (redhat nfs client)
Postgresql uses BSD read/write semantics. The BSD semantics mean an IO call
(either read or write) is atomic.
Linux uses system V read/write semantics. The system V semantics mean an IO
is NOT atomic and can be interrupted.
A read call got interrupted (due to the bug in the nfs client), which meant
the IO call kept waiting until infinity.
It even caused all other IO done against the inode to be waiting, leading to
a situation where the server needed a reboot to be able to function
propertly.

frits

On Thu, Mar 20, 2008 at 9:09 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:

> Chris Hoover wrote:
> > If you have any real life good or bad stories, I'd love to hear it.
> Given
> > the NetApp arrays supposedly being very good NFS platforms, overall, is
> this
> > a recommended way to run PostgreSQL, or is it recommended to not run
> this
> > way.
>
> We do have an NFS section in our documentation at the bottom of this
> page:
>
> http://www.postgresql.org/docs/8.3/static/creating-cluster.html
>
> --
> Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
> EnterpriseDB http://postgres.enterprisedb.com
>
> + If your life is a hard drive, Christ can be your backup. +
>
> --
> Sent via pgsql-performance mailing list (pgsql-performance(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance
>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Chris Hoover <revoohc(at)gmail(dot)com>, PGSQL Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: PostgreSQL NetApp and NFS
Date: 2008-03-20 21:52:29
Message-ID: 24850.1206049949@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> Chris Hoover wrote:
>> If you have any real life good or bad stories, I'd love to hear it. Given
>> the NetApp arrays supposedly being very good NFS platforms, overall, is this
>> a recommended way to run PostgreSQL, or is it recommended to not run this
>> way.

> We do have an NFS section in our documentation at the bottom of this
> page:
> http://www.postgresql.org/docs/8.3/static/creating-cluster.html

Aside from what's said there, I'd note that it's a seriously bad idea
to use a "soft mount" or any arrangement wherein it's possible for
Postgres to be running while the NFS disk is not mounted. Joe Conway
can still show you the scars from learning that lesson, I believe.
See the archives...

regards, tom lane


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Chris Hoover <revoohc(at)gmail(dot)com>, PGSQL Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: PostgreSQL NetApp and NFS
Date: 2008-03-21 03:30:01
Message-ID: 200803210330.m2L3U1T28529@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Chris Hoover wrote:
> >> If you have any real life good or bad stories, I'd love to hear it. Given
> >> the NetApp arrays supposedly being very good NFS platforms, overall, is this
> >> a recommended way to run PostgreSQL, or is it recommended to not run this
> >> way.
>
> > We do have an NFS section in our documentation at the bottom of this
> > page:
> > http://www.postgresql.org/docs/8.3/static/creating-cluster.html
>
> Aside from what's said there, I'd note that it's a seriously bad idea
> to use a "soft mount" or any arrangement wherein it's possible for
> Postgres to be running while the NFS disk is not mounted. Joe Conway
> can still show you the scars from learning that lesson, I believe.
> See the archives...

Do the docs need updating for this?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Chris Hoover <revoohc(at)gmail(dot)com>, PGSQL Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: PostgreSQL NetApp and NFS
Date: 2008-03-21 03:41:18
Message-ID: 12727.1206070878@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> Tom Lane wrote:
>> Aside from what's said there, I'd note that it's a seriously bad idea
>> to use a "soft mount" or any arrangement wherein it's possible for
>> Postgres to be running while the NFS disk is not mounted.

> Do the docs need updating for this?

Wouldn't be a bad idea to mention it, if we're going to have a section
pointing out NFS risks.

regards, tom lane


From: "Dawid Kuroczko" <qnex42(at)gmail(dot)com>
To: "Chris Hoover" <revoohc(at)gmail(dot)com>
Cc: "PGSQL Performance" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: PostgreSQL NetApp and NFS
Date: 2008-03-21 09:34:09
Message-ID: 758d5e7f0803210234l785b115as6f4b42f42fa97f13@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

On Thu, Mar 20, 2008 at 8:32 PM, Chris Hoover <revoohc(at)gmail(dot)com> wrote:
> I just found out that my company is planning on migrating my databases from
> our current ISCSI storage solution to NetApps connected via NFS. I knew
> about the NetApp migration, but always assumed (and shame on me) that I
> would have direct attachments to the servers.

It is also possible to present block devices from NetApp over iSCSI or FC
(I am not sure about licensing model though). You get all the goodies
like thin provisioning (only non-zero blocks are allocated), snapshots and
all, but you see it as a block device. Works fine.

It is also worth to mention that NetApp utilizes somewhat "copy on write"
write strategy -- so whenever you modify a block, new version of the block
is written on its WAFL filesystem. In practical terms it is quite resilient to
random writes (and that read performance is not stellar ;)).

I didn't try putting database on NFS mount directly, but I know NetApp
advertises that such setups are being used with Oracle database
(and allegedly Oracle website's databases are on such setup).
So I would feel quite safe with such a setup.

Oh, and don't forget to set rsize and wsize to 8K-32K (test and write here
what gives best performance!).

Regards,
Dawid


From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Dawid Kuroczko" <qnex42(at)gmail(dot)com>
Cc: "Chris Hoover" <revoohc(at)gmail(dot)com>, "PGSQL Performance" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: PostgreSQL NetApp and NFS
Date: 2008-03-21 13:22:26
Message-ID: 87tzj0qkj1.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

"Dawid Kuroczko" <qnex42(at)gmail(dot)com> writes:

> It is also possible to present block devices from NetApp over iSCSI or FC
> (I am not sure about licensing model though). You get all the goodies
> like thin provisioning (only non-zero blocks are allocated), snapshots and
> all, but you see it as a block device. Works fine.

Note that Postgres doesn't expect to get "out of space" errors on writes
specifically because it pre-allocates blocks. So this "thin provisioning"
thing sounds kind of dangerous.

> It is also worth to mention that NetApp utilizes somewhat "copy on write"
> write strategy -- so whenever you modify a block, new version of the block
> is written on its WAFL filesystem. In practical terms it is quite resilient to
> random writes (and that read performance is not stellar ;)).

Again, Postgres goes to some effort to keep its reads sequential. So this
sounds like it destroys that feature. Random writes don't matter so much
because Postgres has its WAL which it writes sequentially. Writes to data
files aren't in the critical path and can finish after the transaction is
committed.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Chris Hoover <revoohc(at)gmail(dot)com>, PGSQL Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: PostgreSQL NetApp and NFS
Date: 2008-03-21 14:23:45
Message-ID: 200803211423.m2LENjd06173@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Tom Lane wrote:
> >> Aside from what's said there, I'd note that it's a seriously bad idea
> >> to use a "soft mount" or any arrangement wherein it's possible for
> >> Postgres to be running while the NFS disk is not mounted.
>
> > Do the docs need updating for this?
>
> Wouldn't be a bad idea to mention it, if we're going to have a section
> pointing out NFS risks.

Documentation mention added.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/rtmp/diff text/x-diff 1.1 KB

From: Jurgen Haan <jurgen(at)easyflex(dot)nl>
To:
Cc: PGSQL Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: PostgreSQL NetApp and NFS
Date: 2008-03-25 13:33:23
Message-ID: 47E8FF23.2010905@easyflex.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-performance

Well, we're not running PGSQL on a Netapp over NFS, but a DB2 Database.
But nevertheless, it runs quite well. NFS is not a bad choice for your
database, the big memory buffer that allocates the raid6 blocks makes it
all very quick, like you're working directly on a 1+ TB ramdisk.

One important thing to keep in mind, is to make sure the NFS protocol
used is at least V3 and to check your locking options.
This made our DB2 crash, because when configured wrong, the file locking
mechanism on an NFS mount behaves differently than that of the local
storage. These parameters can be forced from the client side (fstab).

But still, with our 100+ GB OLTP database, I'm still quite fond of our
netapp.

-R-

Chris Hoover wrote:
> I just found out that my company is planning on migrating my databases
> from our current ISCSI storage solution to NetApps connected via NFS. I
> knew about the NetApp migration, but always assumed (and shame on me)
> that I would have direct attachments to the servers.

>
> Chris
> --
> Come see how to SAVE money on fuel, decrease harmful emissions, and even
> make MONEY. Visit http://colafuelguy.mybpi.com and join the revolution!

--
Easyflex diensten b.v.
Acaciastraat 16
4921 MA MADE
T: 0162 - 690410
F: 0162 - 690419
E: info(at)easyflex(dot)nl
W: http://www.easyflex.nl