Best-Effort Extent-Same, a btrfs dedupe agent
Zygo Blaxell maintains bees, an open-source btrfs deduplication daemon that uses 1 GB of RAM per 10 TB of unique data to reclaim space on live storage systems.
By Dillip Chowdary • Nov 09, 2026 • Source: github.com
In this post
Developer Zygo Blaxell maintains BEES, officially known as Best-Effort Extent-Same, an open-source block-oriented userspace deduplication agent designed specifically to scale across large btrfs filesystems under GNU General Public License version 3 or later. The project, documented in github.com's report, operates directly on live filesystems by combining offline deduplication mechanics with an incremental data scanning engine. By operating continuously in daemon mode, the software captures newly written blocks as they arrive, dramatically shrinking the window of time that redundant data occupies physical storage without demanding scheduled filesystem downtime.
This technical breakdown examines the operational architecture, resource footprint, and administrative constraints of deploying continuous extent-level deduplication across enterprise and production btrfs volumes. Storage administrators, Linux systems engineers, and infrastructure operators managing high-density storage arrays will find details on memory sizing ratios, privilege boundaries, and snapshot interactions. The analysis evaluates how the utility structures its persistent hash tables, balances input and output throughput via automated throttling, and interfaces directly with native btrfs compression mechanisms to optimize space reclamation.
01What actually changed
The implementation pairs an offline deduplication engine with an incremental data scan capability to minimize the duration data remains un-deduplicated on physical media. Operating as an active userspace daemon, the software scans storage blocks incrementally as fresh data lands on the filesystem rather than relying exclusively on infrequent, batch-oriented maintenance routines. Its scanning mechanism prioritizes the largest extents first during execution, ensuring that storage operators recover the maximum volume of free disk blocks during constrained maintenance windows.
To sustain consistent performance across large datasets, the utility maintains a persistent hash table directly on storage, enabling rapid service restarts after planned or unexpected system shutdowns. Unlike traditional deduplication tools that expand their memory footprint dynamically as filesystems grow, this agent relies on a constant hash table size configured by the administrator. Memory consumption does not scale upward when datasets expand, giving system administrators predictable memory planning even on multi-terabyte production volumes.
02How it works

The engine executes block-level analysis across the target volume by scanning live data structures and matching extents through its scan_one routine. The agent achieves high memory efficiency, operating with as little as 1 gigabyte of hash table space for every 10 terabytes of unique filesystem data, which establishes an operating memory ratio of 0.1 gigabytes per terabyte. The agent monitors system activity and applies automatic self-throttling to keep background input and output overhead from overwhelming active workloads on the host operating system.
Because the utility is designed specifically around native btrfs capabilities, it identifies matching blocks across the whole filesystem, scanning shared data only once regardless of reflink copies or snapshot trees. The deduplication logic operates cleanly alongside native btrfs compression, identifying identical data extents across any arbitrary combination of compressed and uncompressed files. By issuing extent-same operations directly against the btrfs kernel interface, the daemon replaces duplicate blocks with shared references while preserving data integrity on disk.
Advertisement
Tech Pulse Daily
Get tomorrow's pulse first
Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.
03Why it matters
Standard deduplication utilities often struggle with btrfs internals because naive block comparisons fail to account for copy-on-write structures, reflink trees, and variable compression algorithms. This agent recovers significantly more free space from btrfs storage pools than naive dedupers by working directly within the filesystem's structural primitives. Storage clusters running large pools of historical data can eliminate redundant disk allocations without forcing administrators to unmount volumes or schedule disruptive off-peak service maintenance windows.
The persistent hash table architecture avoids lengthy cache warm-up phases following node reboots, restoring active deduplication immediately upon daemon launch. Combined with its ability to prioritize larger extents, the agent ensures that storage recovery yields tangible space reclamation early in each run. Systems running live services benefit from predictable memory overhead, as the fixed hash table guarantees that sudden bursts of file ingest will never trigger out-of-memory kernel panics.
04Who is affected
Systems administrators running btrfs across single systems, virtualized environments, or multi-disk storage arrays are directly affected by the agent's architectural trade-offs. Deploying the daemon requires elevated system privileges, specifically requiring root access with the Linux CAP_SYS_ADMIN capability alongside standard filesystem read and modify permissions. Furthermore, administrators operating older Linux kernels face critical risks, as documented btrfs kernel bugs in legacy releases carry severe data corruption warnings that mandate kernel validation before deployment.
The agent enforces a whole-filesystem operational model that does not accept file lists or support include and exclude filtering rules. Environments that depend on selective directory targeting must account for the daemon processing all data present on the mounted volume. Additionally, initial execution on volumes containing extensive snapshot hierarchies can cause an immediate increase in metadata space usage, requiring administrators to verify that sufficient metadata headroom exists before launching the daemon.
05What to watch
Infrastructure teams evaluating adoption must account for the fixed allocation characteristics of the underlying hash table design. While a constant hash table prevents memory inflation when stored datasets increase in size, the allocated RAM does not decrease if unique data shrinks, requiring deliberate initial sizing. Because the agent is strictly btrfs-only, teams cannot port this deduplication pipeline to ext4, XFS, or ZFS volumes without migrating underlying storage architectures entirely.
Long-term management depends on observing filesystem event counters and monitoring how the daemon coordinates with adjacent btrfs features. Upstream maintenance continues under Zygo Blaxell, with project history spanning 2015 through 2025 under the GPL version 3 license. Operators must actively monitor kernel release notes, track potential metadata exhaustion during initial scans, and verify that automated self-throttling parameters maintain acceptable storage response latencies as background extent consolidation proceeds.
Best-Effort Extent-Same, a btrfs dedupe agent FAQ
What are the memory requirements for running bees on btrfs?
The agent uses a constant hash table that requires as little as 1 GB of memory per 10 TB of unique data, giving an operating ratio of 0.1 GB per TB.
Can the deduplication agent target specific files or directories?
No, the agent operates exclusively as a whole-filesystem deduplication tool and has no include or exclude filters, nor does it accept file lists.
Does running this deduplication tool require downtime or unmounting the filesystem?
No, the daemon operates directly on live data without requiring scheduled downtime, using automatic self-throttling to minimize system impact.
What system permissions are required to run the agent?
Running the daemon requires root privilege, specifically CAP_SYS_ADMIN alongside standard filesystem read and modify capabilities.
Sources
Author
Dillip Chowdary
Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.
Related on Tech Bytes
Advertisement