rpk redpanda tune
rpk redpanda tune
, also referred to as the autotuner, identifies the hardware configuration on your machine and optimizes the Linux kernel to give you the best performance for running Redpanda.
You should run the autotuner as part of the production deployment workflow. Redpanda recommends you first follow a guide for production deployment:
While you follow the guides, consult this reference for details about the autotuner.
Usage
rpk redpanda tune <list of elements to tune> [command] [flags]
When running
rpk redpanda tune
, make sure that your current Linux user has root privileges. The autotuner requires privileged access to the Linux kernel settings.To run
rpk redpanda tune all
on a Redpanda broker automatically after broker or host restarts, configure the serviceredpanda-tuner
, which runsrpk redpanda tune all
, to run at boot-up:For RHEL, after installing the rpm package, run
systemctl
to both start and enable theredpanda-tuner
service:sudo systemctl start redpanda-tuner
sudo systemctl enable redpanda-tunerFor Ubuntu, after installing the apt package, run
systemctl
to start theredpanda-tuner
service (which is already enabled):sudo systemctl start redpanda-tuner
Flags
Value | Type | Description |
--config | string | Redpanda config file, if not set the file will be searched for in the default locations. |
-r, --dirs | strings | List of *data* directories or places to store data, for example:/var/vectorized/redpanda/ , usually your XFS filesystem on an NVMe SSD device. |
-d, --disks | strings | Lists of devices to tune for example sda1 . |
-h, --help | - | Help for tune. Get a help description for a specific tuner: rpk redpanda tune help <tuner> |
-m, --mode | string | Operation Mode: one of: [sq , sq_split , mq ]
|
-n, --nic | strings | Network Interface Controllers to tune. |
--output-script | string | If set tuners will generate tuning file that can later be used to tune the system. |
--reboot-allowed | - | If set will allow tuners to tune boot parameters and request system reboot. |
--timeout | duration | The maximum time to wait for the tune processes to complete. The value passed is a sequence of decimal numbers, each with optional fraction and a unit suffix, such as 300ms , 1.5s or 2h45m . Valid time units arens , us (or µs ), ms , s , m , h (default 10s) |
-v, --verbose | - | Enable verbose logging (default false ). |
Examples
This section provides examples of using the autotuner.
To enable a predetermined set of tuners for production, run the rpk redpanda mode prod command. This command modifies settings in the
redpanda.yaml
configuration file.Enabled features in production mode
Enabling production (`prod`) mode sets the following features, including a subset of tuners:redpanda:
developer_mode: false
rpk:
tune_network: true
tune_disk_scheduler: true
tune_disk_nomerges: true
tune_disk_write_cache: true
tune_disk_irq: true
tune_cpu: true
tune_aio_events: true
tune_clocksource: true
tune_swappiness: true
tune_ballast_file: true
overprovisioned: falseTo list the available tuners and to see whether they're enabled or supported (and a reason for if they're unsupported), run the rpk redpanda tune list command.
To enable or disable a tuner, run the rpk redpanda config set, as the tuner flags are configurable node properties.
Each tuner has a YAML key flag for enabling/disabling itself in
redpanda.yaml
. Most are formed by prependingrpk.tune_
to the name of the tuner listed by rpk redpanda tune list. See the Tuners reference for the exact key for a tuner. For an example of enabling a tuner, the key for theaio_events
tuner isrpk.tune_aio_events
, and it can be enabled with the following command:rpk redpanda config set rpk.tune_aio_events true
To run all available tuners, use the rpk redpanda tune command for
all
:rpk redpanda tune all
To run a specific tuner, use the rpk redpanda tune command for the tuner:
rpk redpanda tune <tuner>
To learn more about a tuner, use the rpk redpanda tune help command for the tuner:
rpk redpanda tune help <tuner>
See also the Tuners reference for descriptions about each tuner.