All of lore.kernel.org
 help / color / mirror / Atom feed
* Increase default NFSv4 server size "max_block_size" to 4MB
@ 2026-03-16  7:51 Cedric Blancher
  2026-03-16 12:39 ` Chuck Lever
  0 siblings, 1 reply; 13+ messages in thread
From: Cedric Blancher @ 2026-03-16  7:51 UTC (permalink / raw)
  To: Linux NFS Mailing List

Good morning!

As debated a while ago, can the default NFSv4 server size for
"max_block_size" be increased to 4MB, please?

Ced
-- 
Cedric Blancher <cedric.blancher@gmail.com>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Increase default NFSv4 server size "max_block_size" to 4MB
  2026-03-16  7:51 Increase default NFSv4 server size "max_block_size" to 4MB Cedric Blancher
@ 2026-03-16 12:39 ` Chuck Lever
  2026-03-16 14:40   ` Roland Mainz
                     ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Chuck Lever @ 2026-03-16 12:39 UTC (permalink / raw)
  To: Cedric Blancher, Linux NFS Mailing List


On Mon, Mar 16, 2026, at 3:51 AM, Cedric Blancher wrote:
> As debated a while ago, can the default NFSv4 server size for
> "max_block_size" be increased to 4MB, please?

There is an administrative setting to raise this limit for
recent versions of the kernel. Can you report your experience
when you raise the limit? Hiccups, performance issues, etc? I
would kind of like this exercise to be data-driven.

What is still unknown to me is which NFS client implementations
can support 4MB or 8MB. Without client support, an increase in
the default in NFSD doesn't mean anything. Rick, Anna, Roland?

-- 
Chuck Lever

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Increase default NFSv4 server size "max_block_size" to 4MB
  2026-03-16 12:39 ` Chuck Lever
@ 2026-03-16 14:40   ` Roland Mainz
  2026-03-16 23:35   ` Rick Macklem
  2026-03-17 13:51   ` Anna Schumaker
  2 siblings, 0 replies; 13+ messages in thread
From: Roland Mainz @ 2026-03-16 14:40 UTC (permalink / raw)
  To: Linux NFS Mailing List

On Mon, Mar 16, 2026 at 1:39 PM Chuck Lever <cel@kernel.org> wrote:
> On Mon, Mar 16, 2026, at 3:51 AM, Cedric Blancher wrote:
> > As debated a while ago, can the default NFSv4 server size for
> > "max_block_size" be increased to 4MB, please?
>
> There is an administrative setting to raise this limit for
> recent versions of the kernel. Can you report your experience
> when you raise the limit? Hiccups, performance issues, etc? I
> would kind of like this exercise to be data-driven.
>
> What is still unknown to me is which NFS client implementations
> can support 4MB or 8MB. Without client support, an increase in
> the default in NFSD doesn't mean anything. Rick, Anna, Roland?

Linux 6.17 NFS server:
$ service nfs-server stop
$ printf '%d\n' $((4*1024*1024)) >/proc/fs/nfsd/max_block_size
$ service nfs-server start

Mounting the filesystem with ms-nfs41-client and compiling Cygwin
bash.exe and ms-nfs41-client with Visual Studio etc. works fine...
... and I verified that |FATTR4_MAXREAD| and |FATTR4_MAXWRITE| have
the value |4194304| as expected.

I didn't make any benchmarks yet, but quick observation shows that
cloning a git from a git bundle on the same NFSv4.2 filesystem is up
from 8.1MB/s to 8.8MB/s.

----

Bye,
Roland
-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz@nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Increase default NFSv4 server size "max_block_size" to 4MB
  2026-03-16 12:39 ` Chuck Lever
  2026-03-16 14:40   ` Roland Mainz
@ 2026-03-16 23:35   ` Rick Macklem
  2026-05-12 13:18     ` Increase FreeBSD NFSv4 nfsd buffer size? " Cedric Blancher
  2026-03-17 13:51   ` Anna Schumaker
  2 siblings, 1 reply; 13+ messages in thread
From: Rick Macklem @ 2026-03-16 23:35 UTC (permalink / raw)
  To: Chuck Lever; +Cc: Cedric Blancher, Linux NFS Mailing List

On Mon, Mar 16, 2026 at 5:41 AM Chuck Lever <cel@kernel.org> wrote:
>
>
> On Mon, Mar 16, 2026, at 3:51 AM, Cedric Blancher wrote:
> > As debated a while ago, can the default NFSv4 server size for
> > "max_block_size" be increased to 4MB, please?
>
> There is an administrative setting to raise this limit for
> recent versions of the kernel. Can you report your experience
> when you raise the limit? Hiccups, performance issues, etc? I
> would kind of like this exercise to be data-driven.
>
> What is still unknown to me is which NFS client implementations
> can support 4MB or 8MB. Without client support, an increase in
> the default in NFSD doesn't mean anything. Rick, Anna, Roland?
Although it has not seen much testing, it is possible to do a > 1Mbyte NFSv4
mount in FreeBSD.
For a 2Mbyte mount, (the only size > 1Mbyte I've tried) the settings would be..
In /boot/loader.conf
kern.maxphys=2097152
vfs.maxbcachebuf=2097152

and in /etc/sysctl.conf
kern.ipc.maxsockbuf=9455616

Then a mount will use 2Mbytes if the server supports it.

I doubt anyone does this, but it works for trivial tests.

Maybe I'll do it during the next bakeathon? rick
ps:It would be really nice if Roland could show up
     (you can attend remotely via tailscale like I do)
     at the next bakeathon.

>
> --
> Chuck Lever
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Increase default NFSv4 server size "max_block_size" to 4MB
  2026-03-16 12:39 ` Chuck Lever
  2026-03-16 14:40   ` Roland Mainz
  2026-03-16 23:35   ` Rick Macklem
@ 2026-03-17 13:51   ` Anna Schumaker
  2026-03-30 18:46     ` Mike Snitzer
  2 siblings, 1 reply; 13+ messages in thread
From: Anna Schumaker @ 2026-03-17 13:51 UTC (permalink / raw)
  To: Chuck Lever, Cedric Blancher, Linux NFS Mailing List



On Mon, Mar 16, 2026, at 8:39 AM, Chuck Lever wrote:
> On Mon, Mar 16, 2026, at 3:51 AM, Cedric Blancher wrote:
>> As debated a while ago, can the default NFSv4 server size for
>> "max_block_size" be increased to 4MB, please?
>
> There is an administrative setting to raise this limit for
> recent versions of the kernel. Can you report your experience
> when you raise the limit? Hiccups, performance issues, etc? I
> would kind of like this exercise to be data-driven.
>
> What is still unknown to me is which NFS client implementations
> can support 4MB or 8MB. Without client support, an increase in
> the default in NFSD doesn't mean anything. Rick, Anna, Roland?

The NFS client would need a code change to support >1MB sizes. I
spent some time playing around with 4MB yesterday and it passed
all my tests.

Anna

>
> -- 
> Chuck Lever

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Increase default NFSv4 server size "max_block_size" to 4MB
  2026-03-17 13:51   ` Anna Schumaker
@ 2026-03-30 18:46     ` Mike Snitzer
  0 siblings, 0 replies; 13+ messages in thread
From: Mike Snitzer @ 2026-03-30 18:46 UTC (permalink / raw)
  To: Anna Schumaker; +Cc: Chuck Lever, Cedric Blancher, Linux NFS Mailing List

On Tue, Mar 17, 2026 at 09:51:23AM -0400, Anna Schumaker wrote:
> 
> 
> On Mon, Mar 16, 2026, at 8:39 AM, Chuck Lever wrote:
> > On Mon, Mar 16, 2026, at 3:51 AM, Cedric Blancher wrote:
> >> As debated a while ago, can the default NFSv4 server size for
> >> "max_block_size" be increased to 4MB, please?
> >
> > There is an administrative setting to raise this limit for
> > recent versions of the kernel. Can you report your experience
> > when you raise the limit? Hiccups, performance issues, etc? I
> > would kind of like this exercise to be data-driven.
> >
> > What is still unknown to me is which NFS client implementations
> > can support 4MB or 8MB. Without client support, an increase in
> > the default in NFSD doesn't mean anything. Rick, Anna, Roland?
> 
> The NFS client would need a code change to support >1MB sizes. I
> spent some time playing around with 4MB yesterday and it passed
> all my tests.

Is this something you'd be open to posting to the list?

Would be interested to see how 'git clone' improves with it.

Thanks,
Mike

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Increase FreeBSD NFSv4 nfsd buffer size? Re: Increase default NFSv4 server size "max_block_size" to 4MB
  2026-03-16 23:35   ` Rick Macklem
@ 2026-05-12 13:18     ` Cedric Blancher
  2026-05-12 23:02       ` Rick Macklem
  0 siblings, 1 reply; 13+ messages in thread
From: Cedric Blancher @ 2026-05-12 13:18 UTC (permalink / raw)
  To: Rick Macklem, Linux NFS Mailing List, freebsd-hackers

On Tue, 17 Mar 2026 at 00:35, Rick Macklem <rick.macklem@gmail.com> wrote:
>
> On Mon, Mar 16, 2026 at 5:41 AM Chuck Lever <cel@kernel.org> wrote:
> >
> >
> > On Mon, Mar 16, 2026, at 3:51 AM, Cedric Blancher wrote:
> > > As debated a while ago, can the default NFSv4 server size for
> > > "max_block_size" be increased to 4MB, please?
> >
> > There is an administrative setting to raise this limit for
> > recent versions of the kernel. Can you report your experience
> > when you raise the limit? Hiccups, performance issues, etc? I
> > would kind of like this exercise to be data-driven.
> >
> > What is still unknown to me is which NFS client implementations
> > can support 4MB or 8MB. Without client support, an increase in
> > the default in NFSD doesn't mean anything. Rick, Anna, Roland?
> Although it has not seen much testing, it is possible to do a > 1Mbyte NFSv4
> mount in FreeBSD.
> For a 2Mbyte mount, (the only size > 1Mbyte I've tried) the settings would be..
> In /boot/loader.conf
> kern.maxphys=2097152
> vfs.maxbcachebuf=2097152
>
> and in /etc/sysctl.conf
> kern.ipc.maxsockbuf=9455616
>
> Then a mount will use 2Mbytes if the server supports it.

How can I verify that the FreeBSD NFSv4 nfsd now uses 2M for NFS buffers?

Ced
-- 
Cedric Blancher <cedric.blancher@gmail.com>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Increase FreeBSD NFSv4 nfsd buffer size? Re: Increase default NFSv4 server size "max_block_size" to 4MB
  2026-05-12 13:18     ` Increase FreeBSD NFSv4 nfsd buffer size? " Cedric Blancher
@ 2026-05-12 23:02       ` Rick Macklem
  2026-05-13  8:37         ` Cedric Blancher
  0 siblings, 1 reply; 13+ messages in thread
From: Rick Macklem @ 2026-05-12 23:02 UTC (permalink / raw)
  To: Cedric Blancher; +Cc: Linux NFS Mailing List, freebsd-hackers

On Tue, May 12, 2026 at 6:18 AM Cedric Blancher
<cedric.blancher@gmail.com> wrote:
>
> On Tue, 17 Mar 2026 at 00:35, Rick Macklem <rick.macklem@gmail.com> wrote:
> >
> > On Mon, Mar 16, 2026 at 5:41 AM Chuck Lever <cel@kernel.org> wrote:
> > >
> > >
> > > On Mon, Mar 16, 2026, at 3:51 AM, Cedric Blancher wrote:
> > > > As debated a while ago, can the default NFSv4 server size for
> > > > "max_block_size" be increased to 4MB, please?
> > >
> > > There is an administrative setting to raise this limit for
> > > recent versions of the kernel. Can you report your experience
> > > when you raise the limit? Hiccups, performance issues, etc? I
> > > would kind of like this exercise to be data-driven.
> > >
> > > What is still unknown to me is which NFS client implementations
> > > can support 4MB or 8MB. Without client support, an increase in
> > > the default in NFSD doesn't mean anything. Rick, Anna, Roland?
> > Although it has not seen much testing, it is possible to do a > 1Mbyte NFSv4
> > mount in FreeBSD.
> > For a 2Mbyte mount, (the only size > 1Mbyte I've tried) the settings would be..
> > In /boot/loader.conf
> > kern.maxphys=2097152
> > vfs.maxbcachebuf=2097152
> >
> > and in /etc/sysctl.conf
> > kern.ipc.maxsockbuf=9455616
> >
> > Then a mount will use 2Mbytes if the server supports it.
>
> How can I verify that the FreeBSD NFSv4 nfsd now uses 2M for NFS buffers?
The default is 128K. (You can see what it is via "sysctl vfs.nfsd.srvmaxio".)

With "main", you can increase that up to 4M by putting
nfs_server_maxio=N (where N can be up to 4194304 for "main" and 1048576 for 15)
- adding an entry in /etc/sysctl.conf for a larger value for kern.ipc.maxsockbuf
  (It will tell you the recommended minimum setting if you boot after
   putting nfs_server_maxio=N in /etc/rc.conf.)

rick

>
> Ced
> --
> Cedric Blancher <cedric.blancher@gmail.com>
> [https://plus.google.com/u/0/+CedricBlancher/]
> Institute Pasteur

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Increase FreeBSD NFSv4 nfsd buffer size? Re: Increase default NFSv4 server size "max_block_size" to 4MB
  2026-05-12 23:02       ` Rick Macklem
@ 2026-05-13  8:37         ` Cedric Blancher
  2026-05-13 23:38           ` Rick Macklem
  0 siblings, 1 reply; 13+ messages in thread
From: Cedric Blancher @ 2026-05-13  8:37 UTC (permalink / raw)
  To: Linux NFS Mailing List, freebsd-hackers

On Wed, 13 May 2026 at 01:02, Rick Macklem <rick.macklem@gmail.com> wrote:
>
> On Tue, May 12, 2026 at 6:18 AM Cedric Blancher
> <cedric.blancher@gmail.com> wrote:
> >
> > On Tue, 17 Mar 2026 at 00:35, Rick Macklem <rick.macklem@gmail.com> wrote:
> > >
> > > On Mon, Mar 16, 2026 at 5:41 AM Chuck Lever <cel@kernel.org> wrote:
> > > >
> > > >
> > > > On Mon, Mar 16, 2026, at 3:51 AM, Cedric Blancher wrote:
> > > > > As debated a while ago, can the default NFSv4 server size for
> > > > > "max_block_size" be increased to 4MB, please?
> > > >
> > > > There is an administrative setting to raise this limit for
> > > > recent versions of the kernel. Can you report your experience
> > > > when you raise the limit? Hiccups, performance issues, etc? I
> > > > would kind of like this exercise to be data-driven.
> > > >
> > > > What is still unknown to me is which NFS client implementations
> > > > can support 4MB or 8MB. Without client support, an increase in
> > > > the default in NFSD doesn't mean anything. Rick, Anna, Roland?
> > > Although it has not seen much testing, it is possible to do a > 1Mbyte NFSv4
> > > mount in FreeBSD.
> > > For a 2Mbyte mount, (the only size > 1Mbyte I've tried) the settings would be..
> > > In /boot/loader.conf
> > > kern.maxphys=2097152
> > > vfs.maxbcachebuf=2097152
> > >
> > > and in /etc/sysctl.conf
> > > kern.ipc.maxsockbuf=9455616
> > >
> > > Then a mount will use 2Mbytes if the server supports it.
> >
> > How can I verify that the FreeBSD NFSv4 nfsd now uses 2M for NFS buffers?
> The default is 128K. (You can see what it is via "sysctl vfs.nfsd.srvmaxio".)
>
> With "main",

Which FreeBSD version is "main" exactly, i.e. which 16.0 snapshot
date? Is this supported for 15.0?

> you can increase that up to 4M by putting
> nfs_server_maxio=N (where N can be up to 4194304 for "main" and 1048576 for 15)

What line do I have to put into /etc/sysctl.conf and /etc/rc.conf?

> - adding an entry in /etc/sysctl.conf for a larger value for kern.ipc.maxsockbuf
>   (It will tell you the recommended minimum setting if you boot after
>    putting nfs_server_maxio=N in /etc/rc.conf.)

How can I verify that the settings work, on the NFS server side? Can
we programmatically probe which values are supported?

Ced
-- 
Cedric Blancher <cedric.blancher@gmail.com>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Increase FreeBSD NFSv4 nfsd buffer size? Re: Increase default NFSv4 server size "max_block_size" to 4MB
  2026-05-13  8:37         ` Cedric Blancher
@ 2026-05-13 23:38           ` Rick Macklem
  2026-05-14 22:39             ` Rick Macklem
  0 siblings, 1 reply; 13+ messages in thread
From: Rick Macklem @ 2026-05-13 23:38 UTC (permalink / raw)
  To: Cedric Blancher; +Cc: Linux NFS Mailing List, freebsd-hackers

On Wed, May 13, 2026 at 1:37 AM Cedric Blancher
<cedric.blancher@gmail.com> wrote:
>
> On Wed, 13 May 2026 at 01:02, Rick Macklem <rick.macklem@gmail.com> wrote:
> >
> > On Tue, May 12, 2026 at 6:18 AM Cedric Blancher
> > <cedric.blancher@gmail.com> wrote:
> > >
> > > On Tue, 17 Mar 2026 at 00:35, Rick Macklem <rick.macklem@gmail.com> wrote:
> > > >
> > > > On Mon, Mar 16, 2026 at 5:41 AM Chuck Lever <cel@kernel.org> wrote:
> > > > >
> > > > >
> > > > > On Mon, Mar 16, 2026, at 3:51 AM, Cedric Blancher wrote:
> > > > > > As debated a while ago, can the default NFSv4 server size for
> > > > > > "max_block_size" be increased to 4MB, please?
> > > > >
> > > > > There is an administrative setting to raise this limit for
> > > > > recent versions of the kernel. Can you report your experience
> > > > > when you raise the limit? Hiccups, performance issues, etc? I
> > > > > would kind of like this exercise to be data-driven.
> > > > >
> > > > > What is still unknown to me is which NFS client implementations
> > > > > can support 4MB or 8MB. Without client support, an increase in
> > > > > the default in NFSD doesn't mean anything. Rick, Anna, Roland?
> > > > Although it has not seen much testing, it is possible to do a > 1Mbyte NFSv4
> > > > mount in FreeBSD.
> > > > For a 2Mbyte mount, (the only size > 1Mbyte I've tried) the settings would be..
> > > > In /boot/loader.conf
> > > > kern.maxphys=2097152
> > > > vfs.maxbcachebuf=2097152
> > > >
> > > > and in /etc/sysctl.conf
> > > > kern.ipc.maxsockbuf=9455616
> > > >
> > > > Then a mount will use 2Mbytes if the server supports it.
> > >
> > > How can I verify that the FreeBSD NFSv4 nfsd now uses 2M for NFS buffers?
> > The default is 128K. (You can see what it is via "sysctl vfs.nfsd.srvmaxio".)
> >
> > With "main",
>
> Which FreeBSD version is "main" exactly, i.e. which 16.0 snapshot
> date? Is this supported for 15.0?
>
> > you can increase that up to 4M by putting
> > nfs_server_maxio=N (where N can be up to 4194304 for "main" and 1048576 for 15)
>
> What line do I have to put into /etc/sysctl.conf and /etc/rc.conf?
Oops, my bad. It isn't committed yet. I forgot that I have to convince the
FreeBSD collective to increase UIO_MAXIOV or convince the ZFS folk
to not check for that limit in ZFS.

I will email when it gets into "main".

It can currently be set to 1Mbyte via
nfs_server_maxio=1048576
in /etc/rc.conf and
kern.ipc.maxsockbuf=5242880  (the exact minimum setting is printed
                                                    out if you boot
without this set large
                                                     enough in
/etc/sysctl.conf.)
                                                   --> it must be at
least a little more than
                                                        4 *
nfs_server_maxio so that 4 reads
                                                        or writes fit
in the socket's buffers.

rick

>
> > - adding an entry in /etc/sysctl.conf for a larger value for kern.ipc.maxsockbuf
> >   (It will tell you the recommended minimum setting if you boot after
> >    putting nfs_server_maxio=N in /etc/rc.conf.)
>
> How can I verify that the settings work, on the NFS server side?
Look in a wireshark packet trace for maxread and maxwrite in a
GETATTR reply.

> Can
> we programmatically probe which values are supported?
The sysctl is vfs.nfsd.srvmaxio and, when you try and set this
to too large a value, it will fail with EINVAL.
(You can do this from C via the sysctl(3) library call. See "man 3 sysctl".)

rick

>
> Ced
> --
> Cedric Blancher <cedric.blancher@gmail.com>
> [https://plus.google.com/u/0/+CedricBlancher/]
> Institute Pasteur
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Increase FreeBSD NFSv4 nfsd buffer size? Re: Increase default NFSv4 server size "max_block_size" to 4MB
  2026-05-13 23:38           ` Rick Macklem
@ 2026-05-14 22:39             ` Rick Macklem
  2026-05-14 22:52               ` vermaden
  2026-05-14 23:49               ` Rick Macklem
  0 siblings, 2 replies; 13+ messages in thread
From: Rick Macklem @ 2026-05-14 22:39 UTC (permalink / raw)
  To: Cedric Blancher; +Cc: Linux NFS Mailing List, freebsd-hackers

On Wed, May 13, 2026 at 4:38 PM Rick Macklem <rick.macklem@gmail.com> wrote:
>
> On Wed, May 13, 2026 at 1:37 AM Cedric Blancher
> <cedric.blancher@gmail.com> wrote:
> >
> > On Wed, 13 May 2026 at 01:02, Rick Macklem <rick.macklem@gmail.com> wrote:
> > >
> > > On Tue, May 12, 2026 at 6:18 AM Cedric Blancher
> > > <cedric.blancher@gmail.com> wrote:
> > > >
> > > > On Tue, 17 Mar 2026 at 00:35, Rick Macklem <rick.macklem@gmail.com> wrote:
> > > > >
> > > > > On Mon, Mar 16, 2026 at 5:41 AM Chuck Lever <cel@kernel.org> wrote:
> > > > > >
> > > > > >
> > > > > > On Mon, Mar 16, 2026, at 3:51 AM, Cedric Blancher wrote:
> > > > > > > As debated a while ago, can the default NFSv4 server size for
> > > > > > > "max_block_size" be increased to 4MB, please?
> > > > > >
> > > > > > There is an administrative setting to raise this limit for
> > > > > > recent versions of the kernel. Can you report your experience
> > > > > > when you raise the limit? Hiccups, performance issues, etc? I
> > > > > > would kind of like this exercise to be data-driven.
> > > > > >
> > > > > > What is still unknown to me is which NFS client implementations
> > > > > > can support 4MB or 8MB. Without client support, an increase in
> > > > > > the default in NFSD doesn't mean anything. Rick, Anna, Roland?
> > > > > Although it has not seen much testing, it is possible to do a > 1Mbyte NFSv4
> > > > > mount in FreeBSD.
> > > > > For a 2Mbyte mount, (the only size > 1Mbyte I've tried) the settings would be..
> > > > > In /boot/loader.conf
> > > > > kern.maxphys=2097152
> > > > > vfs.maxbcachebuf=2097152
> > > > >
> > > > > and in /etc/sysctl.conf
> > > > > kern.ipc.maxsockbuf=9455616
> > > > >
> > > > > Then a mount will use 2Mbytes if the server supports it.
> > > >
> > > > How can I verify that the FreeBSD NFSv4 nfsd now uses 2M for NFS buffers?
> > > The default is 128K. (You can see what it is via "sysctl vfs.nfsd.srvmaxio".)
> > >
> > > With "main",
> >
> > Which FreeBSD version is "main" exactly, i.e. which 16.0 snapshot
> > date? Is this supported for 15.0?
The commit just hit "main" as b92b9da33006. So any snapshot after
to-day should have it. (It will be MFC'd to stable/15 in 2 weeks and will
be in 15.2.)

To enable it, put this line in /etc/rc.conf:
nfs_server_maxio=4194304
and this line in /etc/sysctl.conf:
kern.ipc.maxsockbuf=18892800 (or larger)

rick

> >
> > > you can increase that up to 4M by putting
> > > nfs_server_maxio=N (where N can be up to 4194304 for "main" and 1048576 for 15)
> >
> > What line do I have to put into /etc/sysctl.conf and /etc/rc.conf?
> Oops, my bad. It isn't committed yet. I forgot that I have to convince the
> FreeBSD collective to increase UIO_MAXIOV or convince the ZFS folk
> to not check for that limit in ZFS.
>
> I will email when it gets into "main".
>
> It can currently be set to 1Mbyte via
> nfs_server_maxio=1048576
> in /etc/rc.conf and
> kern.ipc.maxsockbuf=5242880  (the exact minimum setting is printed
>                                                     out if you boot
> without this set large
>                                                      enough in
> /etc/sysctl.conf.)
>                                                    --> it must be at
> least a little more than
>                                                         4 *
> nfs_server_maxio so that 4 reads
>                                                         or writes fit
> in the socket's buffers.
>
> rick
>
> >
> > > - adding an entry in /etc/sysctl.conf for a larger value for kern.ipc.maxsockbuf
> > >   (It will tell you the recommended minimum setting if you boot after
> > >    putting nfs_server_maxio=N in /etc/rc.conf.)
> >
> > How can I verify that the settings work, on the NFS server side?
> Look in a wireshark packet trace for maxread and maxwrite in a
> GETATTR reply.
>
> > Can
> > we programmatically probe which values are supported?
> The sysctl is vfs.nfsd.srvmaxio and, when you try and set this
> to too large a value, it will fail with EINVAL.
> (You can do this from C via the sysctl(3) library call. See "man 3 sysctl".)
>
> rick
>
> >
> > Ced
> > --
> > Cedric Blancher <cedric.blancher@gmail.com>
> > [https://plus.google.com/u/0/+CedricBlancher/]
> > Institute Pasteur
> >

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Increase FreeBSD NFSv4 nfsd buffer size? Re: Increase default NFSv4 server size "max_block_size" to 4MB
  2026-05-14 22:39             ` Rick Macklem
@ 2026-05-14 22:52               ` vermaden
  2026-05-14 23:49               ` Rick Macklem
  1 sibling, 0 replies; 13+ messages in thread
From: vermaden @ 2026-05-14 22:52 UTC (permalink / raw)
  To: Rick Macklem, Cedric Blancher
  Cc: Linux NFS Mailing List, freebsd-hackers@freebsd.org


> To enable it, put this line in /etc/rc.conf:
> nfs_server_maxio=4194304
> and this line in /etc/sysctl.conf:
> kern.ipc.maxsockbuf=18892800 (or larger)
> 
> rick

An idea ... if 'nfs_server_maxio' already sets the 'vfs.nfsd.srvmaxio' maybe it should automatically also set 'kern.ipc.maxsockbuf' to 4*nfs_server_maxio first?

I mean ... if someone wants to just use /etc/rc.conf for this - that seams reasonable ... and if someone uses /etc/sysctl.conf file instead - he will have both of them there anyway and will not use 'nfs_server_maxio' option:

    vfs.nfsd.srvmaxio=ASD
    kern.ipc.maxsockbuf=8*ASD

Regards,
vermaden





^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Increase FreeBSD NFSv4 nfsd buffer size? Re: Increase default NFSv4 server size "max_block_size" to 4MB
  2026-05-14 22:39             ` Rick Macklem
  2026-05-14 22:52               ` vermaden
@ 2026-05-14 23:49               ` Rick Macklem
  1 sibling, 0 replies; 13+ messages in thread
From: Rick Macklem @ 2026-05-14 23:49 UTC (permalink / raw)
  To: Cedric Blancher; +Cc: Linux NFS Mailing List, freebsd-hackers

On Thu, May 14, 2026 at 3:39 PM Rick Macklem <rick.macklem@gmail.com> wrote:
>
> On Wed, May 13, 2026 at 4:38 PM Rick Macklem <rick.macklem@gmail.com> wrote:
> >
> > On Wed, May 13, 2026 at 1:37 AM Cedric Blancher
> > <cedric.blancher@gmail.com> wrote:
> > >
> > > On Wed, 13 May 2026 at 01:02, Rick Macklem <rick.macklem@gmail.com> wrote:
> > > >
> > > > On Tue, May 12, 2026 at 6:18 AM Cedric Blancher
> > > > <cedric.blancher@gmail.com> wrote:
> > > > >
> > > > > On Tue, 17 Mar 2026 at 00:35, Rick Macklem <rick.macklem@gmail.com> wrote:
> > > > > >
> > > > > > On Mon, Mar 16, 2026 at 5:41 AM Chuck Lever <cel@kernel.org> wrote:
> > > > > > >
> > > > > > >
> > > > > > > On Mon, Mar 16, 2026, at 3:51 AM, Cedric Blancher wrote:
> > > > > > > > As debated a while ago, can the default NFSv4 server size for
> > > > > > > > "max_block_size" be increased to 4MB, please?
> > > > > > >
> > > > > > > There is an administrative setting to raise this limit for
> > > > > > > recent versions of the kernel. Can you report your experience
> > > > > > > when you raise the limit? Hiccups, performance issues, etc? I
> > > > > > > would kind of like this exercise to be data-driven.
> > > > > > >
> > > > > > > What is still unknown to me is which NFS client implementations
> > > > > > > can support 4MB or 8MB. Without client support, an increase in
> > > > > > > the default in NFSD doesn't mean anything. Rick, Anna, Roland?
> > > > > > Although it has not seen much testing, it is possible to do a > 1Mbyte NFSv4
> > > > > > mount in FreeBSD.
> > > > > > For a 2Mbyte mount, (the only size > 1Mbyte I've tried) the settings would be..
> > > > > > In /boot/loader.conf
> > > > > > kern.maxphys=2097152
> > > > > > vfs.maxbcachebuf=2097152
> > > > > >
> > > > > > and in /etc/sysctl.conf
> > > > > > kern.ipc.maxsockbuf=9455616
> > > > > >
> > > > > > Then a mount will use 2Mbytes if the server supports it.
> > > > >
> > > > > How can I verify that the FreeBSD NFSv4 nfsd now uses 2M for NFS buffers?
> > > > The default is 128K. (You can see what it is via "sysctl vfs.nfsd.srvmaxio".)
> > > >
> > > > With "main",
> > >
> > > Which FreeBSD version is "main" exactly, i.e. which 16.0 snapshot
> > > date? Is this supported for 15.0?
> The commit just hit "main" as b92b9da33006. So any snapshot after
> to-day should have it. (It will be MFC'd to stable/15 in 2 weeks and will
> be in 15.2.)
>
> To enable it, put this line in /etc/rc.conf:
> nfs_server_maxio=4194304
> and this line in /etc/sysctl.conf:
> kern.ipc.maxsockbuf=18892800 (or larger)
Oh, and I should also point out that, for the low end hardware I have,
I have never seen a performance improvement for a maxio setting
above 256Kbytes.  The story may be different for faster hardware,
but I wouldn't just assume that bumping it up will get you better
performance. (There is, of course, also a difference between getting
better performance for a single client vs fair distribution of server
resources across many clients.)

rick

>
> rick
>
> > >
> > > > you can increase that up to 4M by putting
> > > > nfs_server_maxio=N (where N can be up to 4194304 for "main" and 1048576 for 15)
> > >
> > > What line do I have to put into /etc/sysctl.conf and /etc/rc.conf?
> > Oops, my bad. It isn't committed yet. I forgot that I have to convince the
> > FreeBSD collective to increase UIO_MAXIOV or convince the ZFS folk
> > to not check for that limit in ZFS.
> >
> > I will email when it gets into "main".
> >
> > It can currently be set to 1Mbyte via
> > nfs_server_maxio=1048576
> > in /etc/rc.conf and
> > kern.ipc.maxsockbuf=5242880  (the exact minimum setting is printed
> >                                                     out if you boot
> > without this set large
> >                                                      enough in
> > /etc/sysctl.conf.)
> >                                                    --> it must be at
> > least a little more than
> >                                                         4 *
> > nfs_server_maxio so that 4 reads
> >                                                         or writes fit
> > in the socket's buffers.
> >
> > rick
> >
> > >
> > > > - adding an entry in /etc/sysctl.conf for a larger value for kern.ipc.maxsockbuf
> > > >   (It will tell you the recommended minimum setting if you boot after
> > > >    putting nfs_server_maxio=N in /etc/rc.conf.)
> > >
> > > How can I verify that the settings work, on the NFS server side?
> > Look in a wireshark packet trace for maxread and maxwrite in a
> > GETATTR reply.
> >
> > > Can
> > > we programmatically probe which values are supported?
> > The sysctl is vfs.nfsd.srvmaxio and, when you try and set this
> > to too large a value, it will fail with EINVAL.
> > (You can do this from C via the sysctl(3) library call. See "man 3 sysctl".)
> >
> > rick
> >
> > >
> > > Ced
> > > --
> > > Cedric Blancher <cedric.blancher@gmail.com>
> > > [https://plus.google.com/u/0/+CedricBlancher/]
> > > Institute Pasteur
> > >

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-05-14 23:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-16  7:51 Increase default NFSv4 server size "max_block_size" to 4MB Cedric Blancher
2026-03-16 12:39 ` Chuck Lever
2026-03-16 14:40   ` Roland Mainz
2026-03-16 23:35   ` Rick Macklem
2026-05-12 13:18     ` Increase FreeBSD NFSv4 nfsd buffer size? " Cedric Blancher
2026-05-12 23:02       ` Rick Macklem
2026-05-13  8:37         ` Cedric Blancher
2026-05-13 23:38           ` Rick Macklem
2026-05-14 22:39             ` Rick Macklem
2026-05-14 22:52               ` vermaden
2026-05-14 23:49               ` Rick Macklem
2026-03-17 13:51   ` Anna Schumaker
2026-03-30 18:46     ` Mike Snitzer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.