Re: PostgreSQL over NFS?

From: Alfred Perlstein <bright(at)wintelcom(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Shaw Terwilliger <sterwill(at)sourcegear(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL over NFS?
Date: 2001-02-09 23:51:16
Message-ID: 20010209155116.W26076@fw.wintelcom.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

* Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> [010209 15:40] wrote:
> Shaw Terwilliger <sterwill(at)sourcegear(dot)com> writes:
> > I have a client who wants to know how PostgreSQL (7) will perform over
> > NFS. The NFS client is Solaris, the server is a big network storage=20
> > appliance. The network is probably gigabit ethernet.
>
> > My first reaction is to tell them they're just crazy,
>
> I agree.
>
> Aside from the speed issues, there's a serious reliability problem;
> AFAIR, NFS doesn't guarantee very much about write ordering, which
> means a crash could leave you with corrupt data.

Actually NFS has very strong write ordering semantics, it just has
terrible cache coherency. Meaning two machines accessing the same
file will most likely see different things if the file is updated
moderately.

For NFSv2 _all_ writes must be done syncronously. For NFSv3 there's
a seperate commit RPC that needs to succeed before the local machine
returns from fsync.

There's also the issue that NFS requests are done async, meaning
that you won't get an error on write(2)/read(2) until close(2) I'm
not even sure if fsync(2) can or will return an error on an NFS
error, this can be disasterous for a database. You can get around
that by not running any async nfs kernel threads on the client
(nfsiod under *BSD) however your performance will go to pot if you
disable the async NFS subsystem.

Even then there's probably more black magic that can cause wierd
things to happen.

> Seems a lot better to run the Postgres server on the machine where
> the storage is.

Agreed. :)

--
-Alfred Perlstein - [bright(at)wintelcom(dot)net|alfred(at)freebsd(dot)org]
"I have the heart of a child; I keep it in a jar on my desk."

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shaw Terwilliger 2001-02-10 00:04:59 Re: PostgreSQL over NFS?
Previous Message Shaw Terwilliger 2001-02-09 23:44:14 Re: PostgreSQL over NFS?