{"id":13579416,"url":"https://github.com/kahing/catfs","last_synced_at":"2025-05-14T18:05:22.084Z","repository":{"id":22419667,"uuid":"96195960","full_name":"kahing/catfs","owner":"kahing","description":"Cache AnyThing filesystem written in Rust","archived":false,"fork":false,"pushed_at":"2023-10-09T20:05:56.000Z","size":498,"stargazers_count":891,"open_issues_count":34,"forks_count":54,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-05-10T03:56:12.022Z","etag":null,"topics":["cache","cache-storage","filesystem","fuse","fuse-filesystem","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kahing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-07-04T08:43:20.000Z","updated_at":"2025-05-09T05:38:25.000Z","dependencies_parsed_at":"2024-01-16T20:58:54.887Z","dependency_job_id":"95aa15ac-5cbb-454c-b1b4-7f6695c4fc64","html_url":"https://github.com/kahing/catfs","commit_stats":{"total_commits":172,"total_committers":4,"mean_commits":43.0,"dds":"0.12790697674418605","last_synced_commit":"d04beb9066e3920925f5875d8ffa24fcb2b05ef9"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kahing%2Fcatfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kahing%2Fcatfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kahing%2Fcatfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kahing%2Fcatfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kahing","download_url":"https://codeload.github.com/kahing/catfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254198514,"owners_count":22030965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","cache-storage","filesystem","fuse","fuse-filesystem","rust"],"created_at":"2024-08-01T15:01:39.194Z","updated_at":"2025-05-14T18:05:17.047Z","avatar_url":"https://github.com/kahing.png","language":"Rust","funding_links":[],"categories":["Rust","rust"],"sub_categories":[],"readme":"Catfs is a caching filesystem written in Rust.\n\n[![Build Status](https://travis-ci.org/kahing/catfs.svg?branch=master)](https://travis-ci.org/kahing/catfs)\n[![Crates.io](https://img.shields.io/crates/v/catfs.svg)](https://crates.io/crates/catfs)\n[![Crates.io Downloads](https://img.shields.io/crates/d/catfs.svg)](https://crates.io/crates/catfs)\n[![GitHub All Releases](https://img.shields.io/github/downloads/kahing/catfs/total.svg)](https://github.com/kahing/catfs/releases/)\n[![Twitter Follow](https://img.shields.io/twitter/follow/CatfsFuse.svg?style=social\u0026label=Follow)](https://twitter.com/CatfsFuse)\n\n\n# Overview\n\nCatfs allows you to have cached access to another (possibly remote)\nfilesystem. Caching semantic is read-ahead and write-through (see\n[Current Status](#current-status)). Currently it only provides a data\ncache and all metadata operations hit the source filesystem.\n\nCatfs is ALPHA software. Don't use this if you value your data.\n\n# Installation\n\n* On Linux, install via\n  [pre-built binaries](https://github.com/kahing/catfs/releases/). You\n  may also need to install fuse-utils first.\n\n* Or build from source which requires [Cargo](http://doc.crates.io/).\n\n```ShellSession\n:~/catfs$ cargo install catfs\n$ # optimized binary now in $HOME/.cargo/bin/catfs\n```\n\n# Usage\n\nCatfs requires extended attributes (xattr) to be enabled on the\nfilesystem where files are cached to. Typically this means you need to\nhave `user_xattr` mount option turned on.\n\n```ShellSession\n$ catfs \u003cfrom\u003e \u003cto\u003e \u003cmountpoint\u003e\n```\n\nCatfs will expose files in `\u003cfrom\u003e` under `\u003cmountpoint\u003e`, and cache\nthem to `\u003cto\u003e` as they are accessed. You can use `--free` to control\nhow much free space `\u003cto\u003e`'s filesystem has.\n\nTo mount catfs on startup, add this to `/etc/fstab`:\n\n```\ncatfs#/src/dir#/cache/dir /mnt/point    fuse    allow_other,--uid=1001,--gid=1001,--free=1%   0       0\n```\n\n# Benchmark\n\nCompare using catfs to cache sshfs vs sshfs only. Topology is\nlaptop - 802.11n - router - 1Gbps wired - desktop. Laptop has SSD\nwhereas desktop has spinning rust.\n\n![Benchmark result](/bench/bench.catfs_vs_sshfs.png?raw=true \"Benchmark\")\n\nCompare running catfs with two local directories on the same\nfilesystem with direct access. This is not a realistic use case but\nshould give you an idea of the worst case slowdown.\n\n![Benchmark result](/bench/bench.png?raw=true \"Benchmark\")\n\nWrite is twice as slow as expected since we are writing twice the\namount.\n\n\u003ca name=\"runbenchmark\"\u003e\u003c/a\u003e\nTo run the benchmark, do:\n\n```ShellSession\n$ sudo docker run -e SSHFS_SERVER=user@host --rm --privileged --net=host -v $PWD/target:/root/catfs/target kahing/catfs-bench\n # result is written to $PWD/target\n```\n\nThe docker container will need to be able to ssh to `user@host`. Typically I arrange that by mounting the ssh socket from the host\n\n```ShellSession\n$ sudo docker run -e SSHFS_OPTS=\"-o ControlPath=/root/.ssh/sockets/%r@%h_%p -o ControlMaster=auto -o StrictHostKeyChecking=no -o Cipher=arcfour user@host:/tmp\" -e SSHFS_SERVER=user@host --rm --privileged --net=host -v $HOME/.ssh/sockets:/root/.ssh/sockets  -v $PWD/target:/root/catfs/target kahing/catfs-bench\n```\n\n# License\n\nCopyright (C) 2017 Ka-Hing Cheung\n\nLicensed under the Apache License, Version 2.0\n\n# Current Status\n\nCatfs is ALPHA software. Don't use this if you value your data.\n\nEntire file is cached if it's open for read, even if nothing is\nactually read.\n\nData is written-through to the source and also cached for each\nwrite. In case of non-sequential writes, `catfs` detects `ENOTSUP`\nemitted by filesystems like `goofys` and falls back to flush the\nentire file on `close()`. Note that in the latter case even changing\none byte will cause the entire file to be re-written.\n\n# References\n\n* Catfs is designed to work with [goofys](https://github.com/kahing/goofys/)\n* [FS-Cache](https://www.kernel.org/doc/Documentation/filesystems/caching/fscache.txt)\n  provides caching for some in kernel filesystems but doesn't support\n  other FUSE filesystems.\n* Other similar fuse caching filesystems, no idea about their completeness:\n  * [CacheFS](https://github.com/cconstantine/CacheFS) - written in\n    Python, not to be confused with FS-Cache above which is in kernel\n  * [fuse-cache](https://sourceforge.net/projects/fuse-cache/)\n  * [gocachefs](https://bitbucket.org/photocrati/gocachefs)\n  * [mcachefs](https://github.com/Doloops/mcachefs)\n  * [pcachefs](https://github.com/ibizaman/pcachefs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkahing%2Fcatfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkahing%2Fcatfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkahing%2Fcatfs/lists"}