<!--startmeta
custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/collectors/proc.plugin/integrations/bcache.md"
meta_yaml: "https://github.com/netdata/netdata/edit/master/src/collectors/proc.plugin/metadata.yaml"
sidebar_label: "BCache"
learn_status: "Published"
learn_rel_path: "Collecting Metrics/Collectors/Storage and Filesystems"
keywords: ['bcache', 'cache', 'ssd', 'block devices']
message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
endmeta-->

# BCache


<img src="https://netdata.cloud/img/hard-drive.svg" width="150"/>


Plugin: proc.plugin
Module: /sys/fs/bcache

<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />

## Overview

Statistics for BCache (block layer cache) devices, including cache hit ratios, I/O operations, cache allocations, and bypass activity.




This collector is only supported on the following platforms:

- Linux

This collector supports collecting metrics from multiple instances of this integration, including remote instances.


### Default Behavior

#### Auto-Detection

Automatically detects BCache devices by reading stats from `/sys/block/*/bcache/`.


#### Limits

The default configuration for this integration does not impose any limits on data collection.

#### Performance Impact

The default configuration for this integration is not expected to impose a significant performance impact on the system.

## Setup


### Prerequisites

No action required.

### Configuration

#### Options



There are no configuration options.



#### via File

The configuration file name for this integration is `netdata.conf`.

The file format is a modified INI syntax. The general structure is:

```ini
[section1]
    option1 = some value
    option2 = some other value

[section2]
    option3 = some third value
```
You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-configuration-files) script from the
Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#locate-your-config-directory).

```bash
cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
sudo ./edit-config netdata.conf
```

##### Examples
There are no configuration examples.



## Alerts


The following alerts are available:

| Alert name  | On metric | Description |
|:------------|:----------|:------------|
| [ bcache_cache_dirty ](https://github.com/netdata/netdata/blob/master/src/health/health.d/bcache.conf) | disk.bcache_cache_alloc | percentage of cache space used for dirty data and metadata (this usually means your SSD cache is too small) |
| [ bcache_cache_errors ](https://github.com/netdata/netdata/blob/master/src/health/health.d/bcache.conf) | disk.bcache_cache_read_races | number of times data was read from the cache, the bucket was reused and invalidated in the last 10 minutes (when this occurs the data is reread from the backing device) |


## Metrics

Metrics grouped by *scope*.

The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.



### Per disk



Labels:

| Label      | Description     |
|:-----------|:----------------|
| device | TBD |
| mount_point | TBD |
| device_type | TBD |

Metrics:

| Metric | Dimensions | Unit |
|:------|:----------|:----|
| disk.bcache_cache_alloc | ununsed, dirty, clean, metadata, undefined | percentage |
| disk.bcache_hit_ratio | 5min, 1hour, 1day, ever | percentage |
| disk.bcache_rates | congested, writeback | KiB/s |
| disk.bcache_size | dirty | MiB |
| disk.bcache_usage | avail | percentage |
| disk.bcache_cache_read_races | races, errors | operations/s |
| disk.bcache | hits, misses, collisions, readaheads | operations/s |
| disk.bcache_bypass | hits, misses | operations/s |


