Horrible PostgreSQL performance with NFS

Arne Woerner arne_woerner at yahoo.com
Sat Jan 14 08:14:03 PST 2006

--- Ivan Voras <ivoras at fer.hr> wrote:
> Arne Woerner wrote:
> > But why does switching from local disc
> > to NFS makes the PostgreSQL performance
> > so bad?
> A wild guess/try: does file locking work
> properly with NFS and the filer?
I would recommend the following test in order to answer that

Executing the shell script in appendix A of this email will test,
if locking works, and how fast it is:
% time ./lck-tst.sh </path/to/local-fs/file>
% time ./lck-tst.sh </path/to/NFS/file>


appendix A: the script lck-tst.sh

lockf -k $1 sleep 10 &
sleep 3
lockf -k -s -t 0 $1 echo BAD || echo GOOD

sts=`date +%s`
while [ $i -lt 2000 ]; do
  i=`expr $i + 1`
  lockf -k $1 sleep 0 &
expr `date +%s` - $sts

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the freebsd-performance mailing list