mbox series

[v4,0/7] Intruduce nfsrahead

Message ID 20220401153208.3120851-1-tbecker@redhat.com (mailing list archive)
Headers show
Series Intruduce nfsrahead | expand

Message

Thiago Becker April 1, 2022, 3:32 p.m. UTC
Recent changes in the linux kernel caused NFS readahead to default to
128 from the previous default of 15 * rsize. This causes performance
penalties to some read-heavy workloads, which can be fixed by
tuning the readahead for that given mount.

Specifically, the read troughput on a sec=krb5p mount drops by 50-75%
when comparing the default readahead with a readahead of 15360.

Previous discussions:
https://lore.kernel.org/linux-nfs/20210803130717.2890565-1-trbecker@gmail.com/
I attempted to add a non-kernel option to mount.nfs, and it was
rejected.

https://lore.kernel.org/linux-nfs/20210811171402.947156-1-trbecker@gmail.com/
Attempted to add a mount option to the kernel, rejected as well.

I had started a separate tool to set the readahead of BDIs, but the
scope is specifically for NFS, so I would like to get the community
feeling for having this in nfs-utils.

This patch series introduces nfs-readahead-udev, a utility to
automatically set NFS readahead when NFS is mounted. The utility is
triggered by udev when a new BDI is added, returns to udev the value of
the readahead that should be used.

The tool currently supports setting read ahead per mountpoint, nfs major
version, or by a global default value.

v2:
    - explain the motivation

v3:
    - adopt already available facilities
    - nfsrahead is now configured in nfs.conf

v4:
    - retry getting the device if it fails
    - assorted fixes and improvements

Thiago Becker (7):
  Create nfsrahead
  nfsrahead: configure udev
  nfsrahead: only set readahead for nfs devices.
  nfsrahead: add logging
  nfsrahead: get the information from the config file.
  nfsrahead: User documentation
  nfsrahead: retry getting the device if it fails.

 .gitignore                      |   2 +
 configure.ac                    |   1 +
 systemd/nfs.conf.man            |  11 ++
 tools/Makefile.am               |   2 +-
 tools/nfsrahead/99-nfs.rules.in |   1 +
 tools/nfsrahead/Makefile.am     |  16 +++
 tools/nfsrahead/main.c          | 183 ++++++++++++++++++++++++++++++++
 tools/nfsrahead/nfsrahead.man   |  72 +++++++++++++
 8 files changed, 287 insertions(+), 1 deletion(-)
 create mode 100644 tools/nfsrahead/99-nfs.rules.in
 create mode 100644 tools/nfsrahead/Makefile.am
 create mode 100644 tools/nfsrahead/main.c
 create mode 100644 tools/nfsrahead/nfsrahead.man

Comments

Steve Dickson April 19, 2022, 7:57 p.m. UTC | #1
On 4/1/22 11:32 AM, Thiago Becker wrote:
> Recent changes in the linux kernel caused NFS readahead to default to
> 128 from the previous default of 15 * rsize. This causes performance
> penalties to some read-heavy workloads, which can be fixed by
> tuning the readahead for that given mount.
> 
> Specifically, the read troughput on a sec=krb5p mount drops by 50-75%
> when comparing the default readahead with a readahead of 15360.
> 
> Previous discussions:
> https://lore.kernel.org/linux-nfs/20210803130717.2890565-1-trbecker@gmail.com/
> I attempted to add a non-kernel option to mount.nfs, and it was
> rejected.
> 
> https://lore.kernel.org/linux-nfs/20210811171402.947156-1-trbecker@gmail.com/
> Attempted to add a mount option to the kernel, rejected as well.
> 
> I had started a separate tool to set the readahead of BDIs, but the
> scope is specifically for NFS, so I would like to get the community
> feeling for having this in nfs-utils.
> 
> This patch series introduces nfs-readahead-udev, a utility to
> automatically set NFS readahead when NFS is mounted. The utility is
> triggered by udev when a new BDI is added, returns to udev the value of
> the readahead that should be used.
> 
> The tool currently supports setting read ahead per mountpoint, nfs major
> version, or by a global default value.
> 
> v2:
>      - explain the motivation
> 
> v3:
>      - adopt already available facilities
>      - nfsrahead is now configured in nfs.conf
> 
> v4:
>      - retry getting the device if it fails
>      - assorted fixes and improvements
> 
> Thiago Becker (7):
>    Create nfsrahead
>    nfsrahead: configure udev
>    nfsrahead: only set readahead for nfs devices.
>    nfsrahead: add logging
>    nfsrahead: get the information from the config file.
>    nfsrahead: User documentation
>    nfsrahead: retry getting the device if it fails.
> 
>   .gitignore                      |   2 +
>   configure.ac                    |   1 +
>   systemd/nfs.conf.man            |  11 ++
>   tools/Makefile.am               |   2 +-
>   tools/nfsrahead/99-nfs.rules.in |   1 +
>   tools/nfsrahead/Makefile.am     |  16 +++
>   tools/nfsrahead/main.c          | 183 ++++++++++++++++++++++++++++++++
>   tools/nfsrahead/nfsrahead.man   |  72 +++++++++++++
>   8 files changed, 287 insertions(+), 1 deletion(-)
>   create mode 100644 tools/nfsrahead/99-nfs.rules.in
>   create mode 100644 tools/nfsrahead/Makefile.am
>   create mode 100644 tools/nfsrahead/main.c
>   create mode 100644 tools/nfsrahead/nfsrahead.man
> 
Committed... (tag nfs-utils-2-6-2-rc4)

steved.