tessl install tessl/pypi-pyfuse3@3.4.0Python 3 bindings for libfuse 3 with async I/O support
Optimize pyfuse3 filesystem performance for different workloads.
# Low concurrency (single user, sequential)
await pyfuse3.main(min_tasks=1, max_tasks=10)
# Medium concurrency (typical multi-user)
await pyfuse3.main(min_tasks=5, max_tasks=50)
# High concurrency (servers, many clients)
await pyfuse3.main(min_tasks=10, max_tasks=200)
# I/O-bound (network filesystems)
await pyfuse3.main(min_tasks=10, max_tasks=100)
# CPU-bound (compression, encryption)
await pyfuse3.main(min_tasks=2, max_tasks=20)# Fast-changing data
entry.entry_timeout = 0.1
entry.attr_timeout = 0.1
# Stable data
entry.entry_timeout = 300.0
entry.attr_timeout = 300.0
# Immutable data
entry.entry_timeout = float('inf')
entry.attr_timeout = float('inf')
# No caching
entry.entry_timeout = 0
entry.attr_timeout = 0class FastFS(pyfuse3.Operations):
enable_writeback_cache = True # Better write performance
async def flush(self, fh):
"""Required with writeback cache."""
await self._flush_to_storage(fh)
async def fsync(self, fh, datasync):
"""Required with writeback cache."""
await self._sync_to_storage(fh, datasync)async def open(self, inode, flags, ctx):
"""Use direct I/O for volatile files."""
if self._is_volatile(inode):
return pyfuse3.FileInfo(fh=fh, direct_io=True)
return pyfuse3.FileInfo(fh=fh, direct_io=False)