# Module parameters

The VAST NFS client also supports module parameters that can be configured at module load time to control global behavior:

* `expanding_readahead_enable=<BOOL>` - Enable expanding readahead triggered by
  `fadvise(POSIX_FADV_SEQUENTIAL)` system calls. When enabled, applications that
  signal sequential access patterns will benefit from adaptive readahead that
  starts at `expanding_readahead_initial` size and doubles on each sequential
  access up to the maximum readahead limit. For random access patterns, the
  readahead size is reduced by half to minimize unnecessary prefetching.
  Default: `true`

* `expanding_readahead_mmap_enable=<BOOL>` - Enable expanding readahead triggered
  by memory-mapped file access. When enabled, files accessed via `mmap()` will
  use adaptive readahead similar to the `fadvise` mode above. This is useful for
  applications that memory-map large files and access them sequentially.
  Default: `true`

* `expanding_readahead_initial=<SIZE>` - Set the initial expanding readahead size
  in bytes. This is the starting size for adaptive readahead and also the minimum
  size when readahead is reduced due to random access patterns.
  Default: `131072` (128 KiB)

These parameters can be set when after loading the module:

```
sudo modprobe nfs # ensure kernel module load
echo yes | sudo tee /sys/module/nfs/parameters/expanding_readahead_enable
echo yes | sudo tee /sys/module/nfs/parameters/expanding_readahead_mmap_enable
```

Or configured persistently in `/etc/modprobe.d/`, e.g:

```
options nfs expanding_readahead_enable=1 expanding_readahead_mmap_enable=1
```
