Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Nov 2011 16:36:47 -0800
From:      Xin LI <delphij@gmail.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-stable@freebsd.org, Daryl Sayers <daryl@ci.com.au>
Subject:   Re: Low nfs write throughput
Message-ID:  <CAGMYy3vo_wCT5NQEMDYxwKicpzN4bLFkD3v1iNSBmQhSto%2BTTw@mail.gmail.com>
In-Reply-To: <201111180814.42656.jhb@freebsd.org>
References:  <201111180310.pAI3ARbZ075115@mippet.ci.com.au> <201111180814.42656.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--f46d0444e96b14738804b20ba655
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,

> I don't know if it will help with your performance, but I have some patch=
es
> to allow the NFS server to cluster writes. =C2=A0You can try
> www.freebsd.org/~jhb/patches/nfs_server_cluster.patch. =C2=A0I've tested =
it on 8,
> but it should probably apply fine to 9.

I think 9 would need some changes, I just made them with minimal
compile testing, though.

Cheers,
--=20
Xin LI <delphij@delphij.net> https://www.delphij.net/
FreeBSD - The Power to Serve! Live free or die

--f46d0444e96b14738804b20ba655
Content-Type: text/x-patch; charset=US-ASCII; name="nfs-cluster.diff"
Content-Disposition: attachment; filename="nfs-cluster.diff"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gv5vzwo30

SW5kZXg6IHN5cy9mcy9uZnNzZXJ2ZXIvbmZzX25mc2Rwb3J0LmMKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lz
L2ZzL25mc3NlcnZlci9uZnNfbmZzZHBvcnQuYwkocmV2aXNpb24gMjI3Njg5KQorKysgc3lzL2Zz
L25mc3NlcnZlci9uZnNfbmZzZHBvcnQuYwkod29ya2luZyBjb3B5KQpAQCAtOTAsMjAgKzkwLDc4
IEBAIFNZU0NUTF9JTlQoX3Zmc19uZnNkLCBPS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