bcache tuning #3

Supports: focal bionic xenial cosmic

Description

Tune all bcache devices on a unit with best-practice tuning options.


Overview

This charm performs best-practice performance tuning of bcache devices on SD/NVMe based installations.

Cache Set Configuration

Disable performance based congestion behaviour - the SSD or NVMe will in all likelyhood always be faster than the underlying spindle:

congested_read_threshold_us: 0
congested_write_threshold_us: 0

Bcache Backing Device Configuration

Disable cache readahead:

readahead: 0

Disable writethrough of sequential data writes:

sequential_cutoff: 0

Set the amount of dirty data the cache device will hold before starting to persist to the backing device:

writeback_percent: 10

Sets unmanaged cache_mode:

cache_mode: unmanaged

Usage

To use this charm, simple deploy and relation to principle services:

juju deploy bcache-tuning
juju add-relation bcache-tuning ceph-osd
juju add-relation bcache-tuning nova-compute

This charm presents no configuration options.


Configuration

cache_mode
(string) Can be one of either writethrough, writeback, writearound, none, or unmanaged. The unmanaged setting instructs the charm that the cache mode is managed externally, e.g. via MAAS or manually.
unmanaged
congested_read_threshold_us
(int) Traffic's still going to the spindle/still getting cache misses . In the real world, SSDs don't always keep up with disks - particularly with slower SSDs, many disks being cached by one SSD, or mostly sequential IO. So you want to avoid being bottlenecked by the SSD and having it slow everything down. . To avoid that bcache tracks latency to the cache device, and gradually throttles traffic if the latency exceeds a threshold (it does this by cranking down the sequential bypass). . You can disable this if you need to by setting the thresholds to 0.
congested_write_threshold_us
(int) Traffic's still going to the spindle/still getting cache misses . In the real world, SSDs don't always keep up with disks - particularly with slower SSDs, many disks being cached by one SSD, or mostly sequential IO. So you want to avoid being bottlenecked by the SSD and having it slow everything down. . To avoid that bcache tracks latency to the cache device, and gradually throttles traffic if the latency exceeds a threshold (it does this by cranking down the sequential bypass). . You can disable this if you need to by setting the thresholds to 0.
debug
(boolean) Enable debug logging.
readahead
(int) Size of readahead that should be performed. Defaults to 0. If set to e.g. 1M, it will round cache miss reads up to that size, but without overlapping existing cache entries.
sequential_cutoff
(int) A sequential IO will bypass the cache once it passes this threshhold; the most recent 128 IOs are tracked so sequential IO can be detected even when it isn't all done at once.
writeback_percent
(int) If nonzero, bcache tries to keep around this percentage of the cache dirty by throttling background writeback and using a PD controller to smoothly adjust the rate.
10