Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hierarchical bandwidth and operations rate limits. #16205

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jun 1, 2024

  1. Hierarchical bandwidth and operations rate limits.

    Introduce six new properties: limit_{bw,op}_{read,write,total}.
    
    The limit_bw_* properties limit the read, write, or combined bandwidth,
    respectively, that a dataset and its descendants can consume.
    Limits are applied to both file systems and ZFS volumes.
    
    The configured limits are hierarchical, just like quotas; i.e., even if
    a higher limit is configured on the child dataset, the parent's lower
    limit will be enforced.
    
    The limits are applied at the VFS level, not at the disk level.
    The dataset is charged for each operation even if no disk access is
    required (e.g., due to caching, compression, deduplication,
    or NOP writes) or if the operation will cause more traffic (due to
    the copies property, mirroring, or RAIDZ).
    
    Read bandwidth consumption is based on:
    
    - read-like syscalls, eg., aio_read(2), pread(2), preadv(2), read(2),
      readv(2), sendfile(2)
    
    - syscalls like getdents(2) and getdirentries(2)
    
    - reading via mmaped files
    
    - zfs send
    
    Write bandwidth consumption is based on:
    
    - write-like syscalls, eg., aio_write(2), pwrite(2), pwritev(2),
      write(2), writev(2)
    
    - writing via mmaped files
    
    - zfs receive
    
    The limit_op_* properties limit the read, write, or both metadata
    operations, respectively, that dataset and its descendants can generate.
    
    Read operations consumption is based on:
    
    - read-like syscalls where the number of operations is equal to the
      number of blocks being read (never less than 1)
    
    - reading via mmaped files, where the number of operations is equal
      to the number of pages being read (never less than 1)
    
    - syscalls accessing metadata: readlink(2), stat(2)
    
    Write operations consumption is based on:
    
    - write-like syscalls where the number of operations is equal to the
      number of blocks being written (never less than 1)
    
    - writing via mmaped files, where the number of operations is equal
      to the number of pages being written (never less than 1)
    
    - syscalls modifing a directory's content: bind(2) (UNIX-domain
      sockets), link(2), mkdir(2), mkfifo(2), mknod(2), open(2) (file
      creation), rename(2), rmdir(2), symlink(2), unlink(2)
    
    - syscalls modifing metadata: chflags(2), chmod(2), chown(2),
      utimes(2)
    
    - updating the access time of a file when reading it
    
    Just like limit_bw_* limits, the limit_op_* limits are also
    hierarchical and applied at the VFS level.
    
    Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
    pjd committed Jun 1, 2024
    Configuration menu
    Copy the full SHA
    b4c7ee6 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2024

  1. Hierarchical bandwidth and operations rate limits.

    Introduce six new properties: limit_{bw,op}_{read,write,total}.
    
    The limit_bw_* properties limit the read, write, or combined bandwidth,
    respectively, that a dataset and its descendants can consume.
    Limits are applied to both file systems and ZFS volumes.
    
    The configured limits are hierarchical, just like quotas; i.e., even if
    a higher limit is configured on the child dataset, the parent's lower
    limit will be enforced.
    
    The limits are applied at the VFS level, not at the disk level.
    The dataset is charged for each operation even if no disk access is
    required (e.g., due to caching, compression, deduplication,
    or NOP writes) or if the operation will cause more traffic (due to
    the copies property, mirroring, or RAIDZ).
    
    Read bandwidth consumption is based on:
    
    - read-like syscalls, eg., aio_read(2), pread(2), preadv(2), read(2),
      readv(2), sendfile(2)
    
    - syscalls like getdents(2) and getdirentries(2)
    
    - reading via mmaped files
    
    - zfs send
    
    Write bandwidth consumption is based on:
    
    - write-like syscalls, eg., aio_write(2), pwrite(2), pwritev(2),
      write(2), writev(2)
    
    - writing via mmaped files
    
    - zfs receive
    
    The limit_op_* properties limit the read, write, or both metadata
    operations, respectively, that dataset and its descendants can generate.
    
    Read operations consumption is based on:
    
    - read-like syscalls where the number of operations is equal to the
      number of blocks being read (never less than 1)
    
    - reading via mmaped files, where the number of operations is equal
      to the number of pages being read (never less than 1)
    
    - syscalls accessing metadata: readlink(2), stat(2)
    
    Write operations consumption is based on:
    
    - write-like syscalls where the number of operations is equal to the
      number of blocks being written (never less than 1)
    
    - writing via mmaped files, where the number of operations is equal
      to the number of pages being written (never less than 1)
    
    - syscalls modifing a directory's content: bind(2) (UNIX-domain
      sockets), link(2), mkdir(2), mkfifo(2), mknod(2), open(2) (file
      creation), rename(2), rmdir(2), symlink(2), unlink(2)
    
    - syscalls modifing metadata: chflags(2), chmod(2), chown(2),
      utimes(2)
    
    - updating the access time of a file when reading it
    
    Just like limit_bw_* limits, the limit_op_* limits are also
    hierarchical and applied at the VFS level.
    
    Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
    pjd committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    8c29642 View commit details
    Browse the repository at this point in the history