Bcache is a cache in the Linux kernel's block layer, which is used for accessing fast disk drives such as flash-based solid state drives (SSDs) to act as a cache for one or more slower hard disk drives as a read/write cache or read cache.
Why use a Telegraf plugin for Bcache?
SSDs provide significant improvement in performance over traditional rotating SATA and SAS drives while the costs of SSDs have also declined significantly; this makes it possible for more solutions to make the switch to SSDs. Bcache has some useful metrics about how well your caches are performing, and these metrics can be ingested into an InfluxDB instance using the Bcache Telegraf Plugin. By default, Bcache Telegraf plugin gathers metrics for all Bcache devices, but you can restrict the metric collection to specified Bcache devices.
Key Bcache metrics to use for monitoring
Some of the important Bcache metrics that you can collect include:
- Amount of dirty data for this backing device in the cache. Continuously updated unlike the cache set's version, but may be slightly off.
- Amount of IO (both reads and writes) that has bypassed the cache
- Hits and misses for IO that are intended to skip the cache are still counted, but broken out here.
- Hits and misses are counted per individual IO as Bcache sees them; a partial hit is counted as a miss.
- Counts instances where data was going to be inserted into the cache from a cache miss, but raced with a write and data was already present (usually 0 since the synchronization for cache misses was rewritten)
- Count of times readahead occurred