A high-performance filesystem designed for benchmarking file transfer operations, with both FUSE and native kernel module implementations.
NZFS (Null/Zero Filesystem) is a memory-only filesystem that provides maximum I/O performance by:
- Discarding all write operations immediately (like
/dev/null) - Returning zeros for all read operations (like
/dev/zero) - Storing only metadata in memory
This makes it ideal for benchmarking file transfer tools like rsync, scp, or custom transfer utilities without the overhead of actual disk I/O.
NZFS provides two implementations:
-
FUSE Implementation (
fuse/)- Safe userspace implementation
- Performance: 1.7-6.5 GB/s
- Easy to debug and develop
- No risk of system crashes
-
Kernel Module (
kernel/)- Native kernel implementation
- Performance: 10-30+ GB/s (approaching /dev/null speeds)
- Requires root access
⚠️ WARNING: Can crash your system if buggy
- Maximum Performance: Write operations return immediately without storing data
- Zero Overhead Reads: All reads return zero-filled buffers
- Full Metadata Support: Preserves file attributes, permissions, timestamps for realistic testing
- Thread-Safe: Uses read-write locks for concurrent access
- POSIX Compliant: Supports standard file operations (create, delete, rename, chmod, etc.)
- Memory-Only: All data is volatile and cleared on unmount
- libfuse3-dev
- gcc
- make
- Linux kernel headers (
linux-headers-$(uname -r)) - gcc
- make
- Root access
# Build
cd fuse/
make
# Run
mkdir /tmp/nzfs_mount
./nzfs /tmp/nzfs_mount
# Use filesystem
echo "test" > /tmp/nzfs_mount/file.txt
# Unmount
fusermount -u /tmp/nzfs_mount# Build
cd kernel/
make
# Load module (requires root)
sudo insmod nzfs.ko
# Mount
sudo mkdir -p /mnt/nzfs
sudo mount -t nzfs none /mnt/nzfs
# Use filesystem
echo "test" > /mnt/nzfs/file.txt
# Unmount and unload
sudo umount /mnt/nzfs
sudo rmmod nzfsMount the filesystem:
cd fuse/
mkdir /tmp/nzfs_mount
./nzfs /tmp/nzfs_mountIn another terminal, use the filesystem:
# Create files
echo "test" > /tmp/nzfs_mount/file.txt
# Create directories
mkdir /tmp/nzfs_mount/mydir
# Copy files (writes are instant)
cp large_file.dat /tmp/nzfs_mount/
# Read files (returns zeros)
cat /tmp/nzfs_mount/file.txtUnmount the filesystem:
fusermount -u /tmp/nzfs_mountTo run in background:
./nzfs -o allow_other /tmp/nzfs_mount &Run the test suite:
make testTest rsync performance:
# Mount NZFS
mkdir /tmp/nzfs_bench
./nzfs /tmp/nzfs_bench &
# Benchmark rsync
time rsync -av --progress /large/dataset/ /tmp/nzfs_bench/
# Unmount
fusermount -u /tmp/nzfs_bench- nzfs_node: Represents each file/directory with full stat metadata
- nzfs_state: Global state with linked list of nodes and pthread rwlock
- write(): Accepts data but discards immediately, updates file size
- read(): Returns zero-filled buffer up to file size
- create/mkdir: Allocates metadata structure in memory
- chmod/chown/utimens: Updates metadata only
- rename: Updates path in metadata structure
| Implementation | Write Speed | Read Speed | Safety |
|---|---|---|---|
| /dev/null (baseline) | ~55 GB/s | ~55 GB/s | Safe |
| NZFS Kernel Module | 10-30 GB/s | 10-30 GB/s | Dangerous |
| NZFS FUSE | 1.7 GB/s | 6.5 GB/s | Safe |
| Typical NVMe SSD | 2-3 GB/s | 3-5 GB/s | Safe |
| Typical SATA SSD | 0.5 GB/s | 0.5 GB/s | Safe |
| Typical HDD | 0.1-0.2 GB/s | 0.1-0.2 GB/s | Safe |
# FUSE
dd if=/dev/zero of=/tmp/nzfs_mount/test bs=1M count=10000
# Kernel module
dd if=/dev/zero of=/mnt/nzfs/test bs=1M count=10000
# Baseline
dd if=/dev/zero of=/dev/null bs=1M count=10000- All data is lost on unmount
- No data persistence
- Memory usage grows with number of files
- No quota limits
nzfs/
├── fuse/ # FUSE implementation (safe)
│ ├── src/ # Source code
│ ├── include/ # Header files
│ ├── test/ # Test scripts
│ ├── benchmark.sh # Performance benchmarks
│ ├── profile*.sh # Profiling scripts
│ └── Makefile # Build system
├── kernel/ # Kernel module (dangerous)
│ ├── nzfs_kernel.c # Kernel module source
│ ├── Makefile # Kernel module build
│ ├── test.sh # Test script
│ └── README.md # Usage instructions
└── README.md # Main documentation
make # Build the project
make clean # Clean build artifacts
make test # Run tests
make install # Install system-wide
make uninstall # Remove from systemThis project is provided as-is for benchmarking and testing purposes.
Contributions are welcome. Please ensure all tests pass before submitting changes.
Ensure FUSE kernel module is loaded:
sudo modprobe fuseUse -o allow_other option and ensure user is in the fuse group:
sudo usermod -aG fuse $USERForce unmount:
fusermount -uz /mount/pointOr kill the FUSE process:
killall nzfs