Skip to content

TheFirstIstari/tierfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tierfs

Tiered storage daemon. Promotes hot, demotes cold, prefetches what's next. Sits on top of MergerFS.

Why

No existing tool does automated tiered migration across heterogeneous storage. MergerFS pools but doesn't migrate. Syncthing duplicates. Ceph needs enterprise hardware. tierfs fills the gap.

How it works

  1. MergerFS presents a unified view of all storage branches
  2. tierfs polls atime on files and migrates them between tiers:
    • Hot (SSD) -- actively accessed data
    • Warm (NVMe) -- recently accessed
    • Cold (HDD) -- archive, not accessed in N days
  3. Files move up when accessed, down when idle. One mount point, zero duplication.
  4. Prefetch: when a sequential file is promoted (e.g. IMAGES/0042/file.pdf), tierfs promotes the next N sibling directories to the hot tier.

Requirements

  • Linux (FUSE + atime support)
  • MergerFS installed
  • Go 1.21+

Important: Mounts must use relatime or strictatime. noatime will break tiering entirely.

Build

make

Cross-compile:

make cross

Install

sudo make install

Installs binary to /usr/local/bin/tierfs and systemd unit.

Run

./tierfs config.json

Config

{
  "poll_interval": "10m",
  "pool_mount": "/mnt/pool",
  "mergerfs_bin": "mergerfs",
  "prefetch": 3,
  "api_addr": ":8091",
  "tiers": [
    {"name": "hot",  "path": "/mnt/hot",  "threshold": "1h"},
    {"name": "warm", "path": "/mnt/warm",  "threshold": "168h"},
    {"name": "cold", "path": "/mnt/cold",  "threshold": "720h"}
  ]
}
Field Description
poll_interval How often to scan for tier migrations
pool_mount Where MergerFS presents the unified view
mergerfs_bin Path to mergerfs binary
prefetch Number of sequential sibling directories to promote (0 = off)
api_addr Address for status/metrics HTTP API (empty = off)
tiers Ordered hot to cold. threshold = promote to this tier if atime is within this duration

API

When api_addr is set:

  • GET /status -- JSON: tiers, pool mount, last cycle time, total migrated
  • GET /metrics -- Prometheus-compatible text format

Testing

make test

Podman integration test:

podman-compose -f test/docker-compose.yml up

License

MIT

About

Tiered storage daemon: promotes hot, demotes cold, prefetches what's next. Sits on top of MergerFS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors