zswap-cli - Man Page
command-line tool to control ZSwap Linux kernel module
Synopsis
zswap-cli [OPTION...]
Description
zswap-cli is a command-line tool to control ZSwap Linux kernel module.
Command-Line Options
--help
Print help message and exit.
--version
Print version information and exit.
--config
Get options from the configuration file instead of the cmdline.
--env
Get options from the environment variables instead of the cmdline.
--stats
Get statistics and current settings of ZSwap kernel module.
Supported values:
0
(default) - print both ZSwap kernel module settings and debug information;1
- print ZSwap kernel module settings;2
- print ZSwap kernel module usage summary;3
- print ZSwap kernel module debug information.
-e, --enabled
Enable or disable ZSwap kernel module.
-s, --same_filled_pages_enabled
Enable or disable memory pages deduplication.
-p, --max_pool_percent
The maximum percentage of memory that the compressed pool can occupy.
-c, --compressor
The default compression algorithm.
-z, --zpool
The kernel’s zpool type.
-a, --accept_threshold_percent
The threshold at which ZSwap would start accepting pages again after it became full.
Environment Options
zswap-cli support of getting options from environment variables.
Supported options
- ZSWAP_ENABLED_VALUE - enable (Y) or disable (N) ZSwap kernel module.
- ZSWAP_SAME_FILLED_PAGES_ENABLED_VALUE - enable (Y) or disable (N) memory pages deduplication.
- ZSWAP_MAX_POOL_PERCENT_VALUE - the maximum percentage of memory that the compressed pool can occupy (integer from 1 to 100).
- ZSWAP_COMPRESSOR_VALUE - the default compression algorithm.
- ZSWAP_ZPOOL_VALUE - the kernel’s zpool type.
- ZSWAP_ACCEPT_THRESHOLD_PERCENT_VALUE - the threshold at which ZSwap would start accepting pages again after it became full (integer from 1 to 100).
Forwarding options
Export environment options using export
command:
export ZSWAP_ENABLED_VALUE=Y export ZSWAP_SAME_FILLED_PAGES_ENABLED_VALUE=Y export ZSWAP_MAX_POOL_PERCENT_VALUE=60 export ZSWAP_COMPRESSOR_VALUE=zstd export ZSWAP_ZPOOL_VALUE=z3fold export ZSWAP_ACCEPT_THRESHOLD_PERCENT_VALUE=40
Start application with --env
command-line argument:
sudo zswap-cli --env
Configuration Files
zswap-cli support of getting options from the configuration files.
Supported options
enabled
- enable (Y
) or disable (N
) ZSwap kernel module.same_filled_pages_enabled
- enable (Y
) or disable (N
) memory pages deduplication.max_pool_percent
- the maximum percentage of memory that the compressed pool can occupy (integer from1
to100
).compressor
- the default compression algorithm.zpool
- the kernel’s zpool type.accept_threshold_percent
- the threshold at which ZSwap would start accepting pages again after it became full (integer from1
to100
).
Forwarding options
Start application with --config
command-line argument:
sudo zswap-cli --config /path/to/zswap-cli.conf
Exit Status
0: Successful exit.
1: Insuffient access rights.
Systemd Unit
After installation, the systemd-unit zswap-cli.service will be added.
Changing settings
All settings are stored in the /etc/zswap-cli/zswap-cli.conf configuration file. It uses standard key-value systax.
Enabling unit
Enable systemd-unit and run it on system startup:
sudo systemctl enable --now zswap-cli.service
Disabling unit
Disable systemd-unit and stop runing it on system startup:
sudo systemctl disable zswap-cli.service
Running unit
You can also run systemd-unit without adding it to startup.
Start unit and enable ZSwap:
sudo systemctl start zswap-cli.service
Stop unit and disable ZSwap:
sudo systemctl stop zswap-cli.service
Authors
Copyright (c) 2020-2022 EasyCoding Team and contributors.