What are the default and maximum values for rsize and wsize with NFS mounts?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 4

Issue

  • How to increase the default read/write (block) size on RHEL with NFS.
  • What is the maximum rsize or wsize in Red Hat Enterprise Linux?

Resolution

  • There is no 'default' (in the traditional sense of the word) value for rsize and wsize. The 'default' is to use the largest value that both the client and server support. The maximum rsize and wsize values vary across the various versions of Red Hat Enterprise Linux.
  • If rsize/wsize is not specified in the mount options, the client will query the server and will use the largest size that both support.
  • If rsize/wsize is specified in the mount options and it exceeds the maximum value that either the client or server support, the client will use the largest size that both support.
  • The server maximum is calculated based on the amount of memory specified in totalram_pages (see the table below).
  • The server maximum can be overridden by writing a value to /proc/fs/nfsd/max_block_size.

RHEL NFS Client and Server Maximum rsize/

wsize

VersionKernelClient Maximum (bytes)Server Maximum (bytes)
Red Hat Enterprise Linux 73.10.010485761048576
Red Hat Enterprise Linux 62.6.3210485761048576
Red Hat Enterprise Linux 5.8 and higher2.6.18-308 and higher10485761048576
Red Hat Enterprise Linux 5.0 to 5.72.6.18-8 to 2.6.18-274104857632768
Red Hat Enterprise Linux 42.6.93276832768

Notes:
[1] NFS v2 has a maximum of 8192.
[2] NFS over UDP has a maximum of 32768.

NFS server max blocksize calculation

totalram_pagesSize in MBnfsd_max_blksize
131072-262143512 MB-1023MB131072
262144-5242871024 MB-2047MB262144
524288-10485752048 MB-4095MB524288
1048576+4096 MB+1048576

Notes:
[1] totalram_pages is the amount of 'usable' memory and does not include memory reserved by the BIOS, reserved by the kernel for global data structures, etc. Therefore a server with exactly 4GB of RAM will use 524288 for the maximum blocksize, not 1048576.

Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.