SWAPD(1)

NAME
swapd - add temporary swap as required

SYNOPSIS
swapd -h
swapd -v
swapd [ -d dir ] [ -i interval ] [ -n num ] [ -s size ] [ -l lower ] [ -u upper ]

DESCRIPTION
Swapd periodically monitors the amount of free swap available in the system. It tries to maintain the amount of swap using upper and lower limits. If the amount of free swap falls below the lower limit, it will add an extra swapfile. A swap file will be removed if it will still leave the system with at least the upper limit available.

Since swapping from a file is less efficient than swapping from a partition, this can be used to `top up' the swap when needed (but will also work as the sole source of swap).

OPTIONS

-h  Print the help summary and exit.

-v  Print the version number and exit.

-p prio
    This is the priority at which the process is run. Remember that an increased priority is chosen with a larger negative number. This defaults to -4.

-d dir
    This is the directory in which the swap files are created. This must be a directory, and not a symlink to the directory. This defaults to /var/tmp.

-i interval
    This is the interval between checks on the state of the swap. This defaults to 30 seconds.

-s size
    This is the size of the swap file to create. The actual additional swap will be one page (4K) less due to header in swap file. The largest value for a swap file is 127.6875M.

-l lower
    When the free swap falls below this amount, an additional swap file will be added.

-u upper
    When removing a swap file would leave this amount of swap free, the swap file is removed. This must be larger than the lower limit.

-n num
    This is the maximum number of swap files to create. Currently the total number of swap files or partitions is limited by the kernel to 8.

Values for the size of the swap file, and the upper and lower limits can be suffixed with the letters 'B', 'K', and 'M' to mean multiply by 512, 1024, and 1048576 respectively.

BUGS
Swapping from a file is much slower than swapping from a partition.

If there is a sudden increase in VM requirement, swapd may not get to run quickly enough to add the necessary swap. This can be mitigated by having a large lower limit, and reducing the check interval, but can not be eliminated.

SEE ALSO
mkswap(8), swapon(8), swapoff(8).

AUTHOR
Nick Holloway <Nick.Holloway@alfie.demon.co.uk>