What are the default and maximum values for rsize and wsize with NFS mounts?
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
rsizeandwsize. The 'default' is to use the largest value that both the client and server support. The maximumrsizeandwsizevalues vary across the various versions of Red Hat Enterprise Linux. - If
rsize/wsizeis not specified in the mount options, the client will query the server and will use the largest size that both support. - If
rsize/wsizeis 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
| Version | Kernel | Client Maximum (bytes) | Server Maximum (bytes) |
|---|---|---|---|
| Red Hat Enterprise Linux 7 | 3.10.0 | 1048576 | 1048576 |
| Red Hat Enterprise Linux 6 | 2.6.32 | 1048576 | 1048576 |
| Red Hat Enterprise Linux 5.8 and higher | 2.6.18-308 and higher | 1048576 | 1048576 |
| Red Hat Enterprise Linux 5.0 to 5.7 | 2.6.18-8 to 2.6.18-274 | 1048576 | 32768 |
| Red Hat Enterprise Linux 4 | 2.6.9 | 32768 | 32768 |
Notes:
[1] NFS v2 has a maximum of 8192.
[2] NFS over UDP has a maximum of 32768.
NFS server max blocksize calculation
| totalram_pages | Size in MB | nfsd_max_blksize |
|---|---|---|
| 131072-262143 | 512 MB-1023MB | 131072 |
| 262144-524287 | 1024 MB-2047MB | 262144 |
| 524288-1048575 | 2048 MB-4095MB | 524288 |
| 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.
SBR
Product(s)
Category
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.