########
# bees configuration file
#
# Documentation is available at:
# https://zygo.github.io/bees/config.html
#
# Important gotchas and kernel bugs
# https://zygo.github.io/bees/btrfs-kernel.md
########

# Bees works on a filesystem as a whole. The
# filesystem's unique UUID is used as
# identifier so the correct filesystem is mounted.

# Extra bees command line arguments. Make sure
# you read the documentation before changing these.
# https://zygo.github.io/bees/options.html
#bees_args="--scan-mode=3"

# Use `btrfs filesystem show` to display known
# btrfs filesystems and set the correct uuid.
fsuuid="c3c00bf0-73a6-4aca-91bb-b5e32e76a08c"

# The size of bees hash table in bytes.
# See the chart below for recommended sizes.
# You are encouraged to choose a size that fits your
# needs, and not rely on defaults.
hashsize="$((128*1024*1024))" # 128MiB

# Set bees loglevel.
# 1 is lowest, 8 is most verbose.
# WARNING: a high loglevel increases logfile size greatly.
#loglevel="1"

# Location of the bees status file
#statusfile="/run/bees/${fsuuid}.status"

# Custom logfile location
#logfile="/var/log/bees/${RC_SVCNAME}.log"

## OpenRC resource control

# CPU scheduler controls how Linux schedules CPU
# resources betweed processes.
# "batch" for Batch scheduler
# "idle" for Idle scheduler 
# "other" for default scheduler
#
# It is recommended to use batch or idle combined
# with SSD_NICELEVEL=19
#scheduler="idle"

# ionice values are  0 none, 1 real-time,
# 2 best effort and 3 idle.
#SSD_IONICELEVEL=3

# nice can be -20 to 19, where 19 is lowest priority.
#SSD_NICELEVEL=19

# Out Of Memory score adjustment. A high value increases
# the likelihood that the process will be terminated
# during OOM condition. Allowed values -1000 to 1000.
#SSD_OOM_SCORE_ADJ=0


## Hash table sizing
#
# The relative size of the hash table compared
# to the data set determines the achievable
# deduplication extent size.
# 
# NOTE: The whole hash table will be loaded into RAM.
# 
# A = unique data size
# B = hash table size
# C = average dedupe extent size
#   A  |   B   |   C
# ---------------------
#  1TB |   4GB |    4K
#  1TB |   1GB |   16K
#  1TB | 256MB |   64K
#  1TB | 128MB |  128K <- recommended
#  1TB |  16MB | 1024K
# 64TB |   1GB | 1024K
# The hashsize must be a multiple of 128KiB.
#
# A good starting point is 128KiB average extent size,
# which would mean the following hash sizes for different
# sized data sets. This is just an estimate as many factors
# affect what achievable extent size is possible.
#
# Data
# size   | hashsize
# --------------------------------------
# 256GiB | $((32*1024*1024))"   # 32MiB
# 512GiB | $((64*1024*1024))"   # 64MiB
# 1TiB   | $((128*1024*1024))"  # 128MiB
# 2TiB   | $((256*1024*1024))"  # 256MiB
# 4TiB   | $((512*1024*1024))"  # 512MiB
# 8TiB   | $((1024*1024*1024))" # 1GiB
# 16TiB  | $((2048*1024*1024))" # 2GiB
