Skip to content

fabianschmeltzer/Linux-Bcache-Monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

110 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Linux Bcache Monitor

A lightweight and fast Linux bcache monitoring tool for real-time performance analysis, IO statistics, and cache diagnostics.

Perfect for homelabs, servers, and SSD + HDD cache setups.


✨ Features

  • 📊 Real-time bcache statistics
  • ⚡ Monitor SSD cache performance
  • 💾 Analyze HDD + SSD hybrid setups
  • 🧠 Simple CLI interface (no dependencies)
  • 🔍 Detect IO bottlenecks
  • 🐧 Works on all major Linux distributions

📸 Preview

Demo


🧩 What is bcache?

bcache is a Linux kernel block layer that allows using an SSD as a cache for slower HDDs.

This tool helps you monitor:

  • Cache hit ratio
  • IO throughput
  • Device performance
  • System bottlenecks

🚀 Installation

This curl downloads the file to the current path and makes it executable immediately:

curl -fsSL https://raw.githubusercontent.com/fabianschmeltzer/Linux-Bcache-Monitor/main/bcache-monitor -o ./bcache-monitor && chmod +x ./bcache-monitor

ℹ️ Info, credits, and legal notes

  • Version: 0.6.00
  • Credits: by Fabian Schmeltzer
  • AI note: This program was written with AI assistance and may contain errors. Please verify critical output and use this tool at your own risk.
  • Bug reports: Please submit bugs and improvement suggestions via GitHub Issues: https://github.com/fabianschmeltzer/Linux-Bcache-Monitor/issues
  • Legal note: This is not legal advice. Without an explicit open-source license, standard copyright rules generally apply; GitHub documents that public repositories without a license can be viewed and forked on GitHub, but broader use, distribution, or derivative works require an appropriate license or permission. For binding guidance, consult legal counsel.

📖 What do the values mean?

  • EFF: Cache efficiency from Total Hits / (Total Hits + Total Misses). Low values indicate many accesses are not served by SSD cache.
  • DIRTY: Amount of data in cache that still needs to be written to the HDD/backing device. Especially important in writeback mode.
  • MISS/HIT: Ratio of current misses per second to hits per second. Values around 1.0 or higher mean at least as many requests bypass cache as are served by it.
  • LIVE HIT/s and MISS/s: Live per-second change rate of bcache counters.
  • GRAPH: Red shows MISS/s, green shows HIT/s; marks the newest point, older points.
  • H/M current/avg/peak: Current value, window average, and peak value.
  • MIX: Percentage share of current bcache events. M is miss share, H is hit share. With no load, the tool shows MIX idle because percentages would be misleading.
  • Δ / DELTA: Comparison of current value with window average. If average is 0, n/a is shown.
  • HEALTH: Traffic-light assessment from efficiency, miss/hit ratio, and miss trend.
  • SSD cache / Avail WB: Cache size and potentially available cache share for writeback, when readable from sysfs.
  • HDD/backing: Size of the bcache block device and, if mounted, used/free filesystem space.
  • WB target: Background writeback rate (writeback_rate) reported by bcache in bytes/s. This is bcache's throttle/target rate and not necessarily identical to physical HDD I/O.
  • WB percent / WB running: Target share for dirty data and status indicating whether bcache background writeback is running.
  • HDD write: Real backing-device write rate calculated from /sys/block/<device>/stat between two samples. Helps show whether dirty data is actually draining to HDD.
  • Docker DISK: Read and write rates from Docker BlockIO deltas since the last Docker refresh. The last calculated rate remains visible until a new Docker sample is available.

Reference sources: The Linux kernel documentation describes bcache sysfs values such as dirty_data, writeback_percent, writeback_rate, cache_available_percent, bucket_size, and nbuckets. GitHub Docs and Choose a License explain the legal baseline for repositories without a license.

⚖️ Legal note

This is not legal advice. The tool is provided without warranty; output may be incorrect, incomplete, or outdated. Independently verify critical values before production decisions. Without an explicit open-source license, standard copyright rules generally apply; public GitHub repositories may be viewed and forked under GitHub platform terms, but broader use, distribution, or derivative works require an appropriate license or permission.

🙏 Credits

by Fabian Schmeltzer

This program was written with AI assistance and may contain errors. Please report bugs at https://github.com/fabianschmeltzer/Linux-Bcache-Monitor/issues.

About

Lightweight CLI tool to monitor Linux bcache devices (SSD cache + HDD), including performance metrics, IO stats, and real-time status.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages