[mythtv-users] Storage on SAN
Damien Whyte
damien.whyte at thalesatm.com
Wed Aug 2 10:35:39 UTC 2006
Mark Hetherington wrote:
>How did you increase your NFS performance?
>
>
Hello Mark,
Firstly I'm at work and this is all from memory - and that's not my
strong point. Please be forgiving if I start spouting absolute rubbish !
Basically I believe that the majority of my problems came from the fact
that my frontend was diskless and was mounting its root partition over
the network at boot time. Initially I was not passing any particular NFS
parameters to the kernel at boot time, so I was getting the defaults. It
seems that the defaults picked by the kernel at boot time and the
defaults that are picked by the NFS demon that mounts a disk are
different. This lead to me having different file systems mounted with
different options because of the method they were originally mounted and
caused me a lot of confusion.
I thought my NFS server was using NFS3 to serve the frontend's root
partition, but in fact the kernel time mount of root over NFS defaults
to NFS2 unless specified. Apparently one of the big changes from NFS2
to NFS3 was to default to sync rather than async mounts. Under NFS3 sync
mounts seem to have better performance than under NFS2. As I was
getting my root mounted via NFS2 I was getting a poor performing sync
mount (I had sync specified in my exports file). When I added a kernel
boot time option to force NFS3 I got much better performance.
Some other things that I fiddled with included adding no_wdelay as an
option to my exported filesystems in /etc/exports. From my understanding
of this parameter this may not be beneficial in all circumstances - but
it did seem to improve my writes.
I also played with my settings for rsize and wsize in the /etc/fstab
mount options. Increasing them gave me better performance. I can't
remember the value I settled on but I think it was 16 or 32 k. This may
not be the right option for networks that are dropping packets - but for
me with both machines connected to the same LAN it seemed the right way
to go. BTW I had to add these as a parameters to my kernel's boot time
mount too.
Another thing I also think may have been adversely affecting my
performance was that I had the sync option set in fstab. This sync
option in fstab is not in fact a NFS parameter, but rather a generic
mount parameter. The NFS sync/async setting I previously referred to is
set via the exports file. Unsetting this generic sync parameter in my
fstab file also seemed to help.
Overall it seemed that any one of these changes shouldn't really explain
why I was getting such bad performance. Once I had made all of these
changes however, I saw a vast improvement. In truth some of them may be
just quackery. It seems NFS configuration is somewhat arcane, and
perhaps even a black art. ;-)
If I had time I would like to go back and try all of these changes in
isolation and benchmark them, just for peace of mind.
From the sound of it, your write performance at 5 megabytes/s is not
too bad. I'm assuming that this is over 100 megabit ethernet ? I don't
think you would be getting that kind of performance unless your NFS
configuration was broadly correct. Like I said, when my performance was
bad it was very very bad (200 kilobytes/s). You may be able to squeeze a
bit more performance out of it by tuning some of these parameters
though. If you are interested I'd be pleased to send you my appropriate
config files from home.
All the best,
Damien.
More information about the mythtv-users
mailing list