WormFS uses TOML format for configuration files. This document provides a comprehensive reference for all available configuration options in Phase 1.
- File Format
- Global Settings
- Metadata Store Configuration
- File Store Configuration
- Filesystem Configuration
- Configuration Examples
- Environment-Specific Configurations
Configuration files use the TOML format, organized into sections:
# Global settings (outside any section)
mount_point = "/path/to/mount"
[metadata]
# Metadata store settings
[file_store]
# File store settings
[filesystem]
# Filesystem behavior settingsType: String Required: Yes Description: Directory where WormFS will be mounted Example:
mount_point = "/mnt/wormfs"Notes:
- Must be an absolute path
- Directory must exist before mounting
- Must be empty
- User must have write permissions
The [metadata] section configures the SQLite metadata database.
Type: String Required: Yes Default: None Description: Path to the SQLite database file Example:
[metadata]
database_path = "/var/lib/wormfs/metadata.db"Notes:
- Parent directory must exist
- File will be created if it doesn't exist
- Stores file metadata, directory structure, and inode information
Type: Integer
Required: No
Default: 4
Range: 1-100
Description: Number of read-only database connections in the pool
Example:
[metadata]
read_pool_size = 8Tuning:
- Increase for read-heavy workloads
- Each connection consumes memory
- Recommended: 2× number of CPU cores
Type: Boolean
Required: No
Default: true
Description: Enable SQLite Write-Ahead Logging (WAL) mode
Example:
[metadata]
enable_wal = trueNotes:
- WAL mode improves concurrency
- Better write performance
- Recommended to keep enabled
Type: Integer
Required: No
Default: 100
Range: 1-10000
Description: SQLite page cache size in megabytes
Example:
[metadata]
cache_size_mb = 500Tuning:
- Larger cache = better performance for frequently accessed metadata
- Consumes RAM
- Recommended: 5-10% of available RAM
Type: Boolean
Required: No
Default: true
Description: Enable SQLite foreign key constraints
Example:
[metadata]
enable_foreign_keys = trueNotes:
- Ensures referential integrity
- Recommended to keep enabled
- Required for Phase 1
Type: String
Required: No
Default: "Normal"
Valid Values: "Off", "Normal", "Full"
Description: SQLite synchronous mode
Example:
[metadata]
synchronous = "Normal"Options:
"Off": Fastest, risk of database corruption on crash"Normal": Good balance of speed and safety (recommended)"Full": Slowest, maximum durability
Type: String
Required: No
Default: "Serializable"
Valid Values: "Serializable", "ReadCommitted"
Description: Transaction isolation level
Example:
[metadata]
transaction_isolation = "Serializable"Notes:
"Serializable": Strictest isolation (recommended)"ReadCommitted": Better performance, less isolation
Type: Boolean
Required: No
Default: true
Description: Enable prepared statement caching
Example:
[metadata]
enable_prepared_statements = trueNotes:
- Improves performance
- Recommended to keep enabled
Type: Integer
Required: No
Default: 30
Range: 1-300
Description: Timeout in seconds for acquiring a database connection
Example:
[metadata]
read_pool_timeout_secs = 60The [file_store] section configures erasure coding and chunk storage.
Type: Array of Strings Required: Yes Default: None Description: List of directories where chunks will be stored Example:
[file_store]
disk_paths = ["/var/lib/wormfs/chunks1", "/var/lib/wormfs/chunks2"]Notes:
- All directories must exist
- Can span multiple disks/filesystems
- Phase 1: Only first path is used
Type: Integer
Required: No
Default: 1048576 (1 MB)
Range: 4096-16777216 (4 KB - 16 MB)
Description: Maximum size of individual data chunks in bytes
Example:
[file_store]
max_chunk_size = 2097152 # 2 MBTuning:
- Smaller chunks: Better for small files, more metadata overhead
- Larger chunks: Better for large files, less metadata overhead
- Recommended: 256 KB - 4 MB depending on typical file sizes
Type: Integer
Required: No
Default: 2
Range: 1-16
Description: Number of data shards in erasure coding
Example:
[file_store]
default_data_shards = 4Notes:
- More shards = better parallelism
- Must have:
data_shards + parity_shards >= 2
Type: Integer
Required: No
Default: 1
Range: 1-16
Description: Number of parity (redundancy) shards in erasure coding
Example:
[file_store]
default_parity_shards = 2Storage Overhead: parity_shards / data_shards
Examples:
- 2 data + 1 parity = 50% overhead, can lose 1 shard
- 4 data + 2 parity = 50% overhead, can lose 2 shards
- 8 data + 3 parity = 37.5% overhead, can lose 3 shards
Type: Integer
Required: No
Default: 100
Range: 1-10000
Description: Maximum number of concurrent file operations
Example:
[file_store]
max_concurrent_operations = 500Tuning:
- Higher values: Better throughput under load
- Consumes more memory and file descriptors
- Recommended: 10× number of CPU cores
Type: Integer
Required: No
Default: 3600 (1 hour)
Range: 60-86400 (1 minute - 1 day)
Description: Interval in seconds between chunk verification scans
Example:
[file_store]
verification_interval = 7200 # 2 hoursNotes:
- Phase 1: Not fully implemented
- Future: Periodic integrity checks
Type: Integer
Required: No
Default: 3600 (1 hour)
Range: 60-86400
Description: Age in seconds before orphaned chunks are cleaned up
Example:
[file_store]
orphan_cleanup_age = 86400 # 1 dayNotes:
- Phase 1: Not fully implemented
- Prevents premature deletion of chunks
The [filesystem] section configures filesystem behavior.
Type: Integer Required: Yes Default: None Range: 0-65535 Description: Unique identifier for this filesystem node Example:
[filesystem]
node_id = 1Notes:
- Phase 1: Can be any value
- Future (multi-node): Must be unique across cluster
Type: Integer
Required: No
Default: 86400 (24 hours)
Range: 60-2592000
Description: Client inactivity timeout in seconds
Example:
[filesystem]
client_heartbeat_timeout = 3600Type: Boolean
Required: No
Default: true
Description: Enable read lock support
Example:
[filesystem]
enable_read_locks = trueType: Integer
Required: No
Default: 10
Range: 1-300
Description: Lock acquisition timeout in seconds
Example:
[filesystem]
lock_timeout = 30Type: Integer
Required: No
Default: 5
Range: 1-60
Description: Interval in seconds for automatic lock extension
Example:
[filesystem]
lock_extend_interval = 10Type: Integer
Required: No
Default: 10000
Range: 100-1000000
Description: Maximum number of open file handles
Example:
[filesystem]
max_file_handles = 50000Notes:
- Must be less than system
ulimit -n - Each open file consumes memory
Type: Integer
Required: No
Default: 10000
Range: 100-1000000
Description: Maximum number of cached inode entries
Example:
[filesystem]
inode_cache_size = 100000Tuning:
- Larger cache = fewer database lookups
- Each entry consumes ~1 KB of memory
Type: Integer
Required: No
Default: 60 (1 minute)
Range: 1-3600
Description: Time-to-live for cached inodes in seconds
Example:
[filesystem]
inode_cache_ttl = 300 # 5 minutesType: Integer
Required: No
Default: 1048576 (1 MB)
Range: 4096-16777216
Description: Read buffer size in bytes
Example:
[filesystem]
read_buffer_size = 4194304 # 4 MBTuning:
- Larger buffers: Better performance for large sequential reads
- Consumes more memory per operation
Type: Integer
Required: No
Default: 1048576 (1 MB)
Range: 4096-16777216
Description: Write buffer size in bytes
Example:
[filesystem]
write_buffer_size = 4194304 # 4 MBType: Boolean
Required: No
Default: false
Description: Enable write-through caching
Example:
[filesystem]
write_through = trueOptions:
false: Better performance, data cachedtrue: Slower writes, immediate durability
Type: String or Integer
Required: No
Default: "0644" or 420
Description: Default permissions for new files
Example:
[filesystem]
default_file_mode = "0644" # Octal string (recommended)
# or
default_file_mode = 420 # Decimal integerCommon Values:
"0644"(420): Owner read/write, others read"0600"(384): Owner read/write only"0666"(438): Everyone read/write
Type: String or Integer
Required: No
Default: "0755" or 493
Description: Default permissions for new directories
Example:
[filesystem]
default_dir_mode = "0755" # Octal string (recommended)
# or
default_dir_mode = 493 # Decimal integerCommon Values:
"0755"(493): Owner all, others read/execute"0700"(448): Owner only"0775"(509): Owner/group all, others read/execute
Type: Integer
Required: No
Default: 1099511627776 (1 TB)
Range: 1048576-unlimited
Description: Maximum file size in bytes
Example:
[filesystem]
max_file_size = 10737418240 # 10 GBType: Boolean
Required: No
Default: false
Description: Enable extended attributes (xattr) support
Example:
[filesystem]
enable_xattr = falseNotes:
- Phase 1: Not fully implemented
- Future: Full xattr support
Type: Integer Required: Yes Default: None Range: 0-65535 Description: User ID for filesystem ownership Example:
[filesystem]
uid = 1000Notes:
- Use your user ID:
id -u - Files will be owned by this UID
Type: Integer Required: Yes Default: None Range: 0-65535 Description: Group ID for filesystem ownership Example:
[filesystem]
gid = 1000Notes:
- Use your group ID:
id -g - Files will be owned by this GID
mount_point = "/mnt/wormfs"
[metadata]
database_path = "/var/lib/wormfs/metadata.db"
enable_foreign_keys = true
[file_store]
disk_paths = ["/var/lib/wormfs/chunks"]
[filesystem]
node_id = 1
uid = 1000
gid = 1000mount_point = "/tmp/wormfs-test"
[metadata]
database_path = "/tmp/wormfs-data/metadata.db"
cache_size_mb = 10
enable_wal = true
synchronous = "Normal"
enable_foreign_keys = true
transaction_isolation = "Serializable"
enable_prepared_statements = true
[file_store]
disk_paths = ["/tmp/wormfs-data/chunks"]
max_chunk_size = 262144 # 256 KB for testing
default_data_shards = 2
default_parity_shards = 1
max_concurrent_operations = 50
[filesystem]
node_id = 1
enable_read_locks = true
max_file_handles = 1000
inode_cache_size = 1000
inode_cache_ttl = 30
read_buffer_size = 524288 # 512 KB
write_buffer_size = 524288 # 512 KB
write_through = false
default_file_mode = "0644"
default_dir_mode = "0755"
max_file_size = 10737418240 # 10 GB
enable_xattr = false
uid = 1000
gid = 1000mount_point = "/mnt/wormfs"
[metadata]
database_path = "/var/lib/wormfs/metadata.db"
read_pool_size = 16
cache_size_mb = 1000
enable_wal = true
synchronous = "Normal"
enable_foreign_keys = true
transaction_isolation = "Serializable"
enable_prepared_statements = true
read_pool_timeout_secs = 60
[file_store]
disk_paths = [
"/mnt/disk1/wormfs/chunks",
"/mnt/disk2/wormfs/chunks",
"/mnt/disk3/wormfs/chunks"
]
max_chunk_size = 1048576 # 1 MB
default_data_shards = 4
default_parity_shards = 2
max_concurrent_operations = 1000
verification_interval = 3600
orphan_cleanup_age = 86400
[filesystem]
node_id = 1
client_heartbeat_timeout = 86400
enable_read_locks = true
lock_timeout = 30
lock_extend_interval = 10
max_file_handles = 100000
inode_cache_size = 100000
inode_cache_ttl = 300
read_buffer_size = 4194304 # 4 MB
write_buffer_size = 4194304 # 4 MB
write_through = false
default_file_mode = "0644"
default_dir_mode = "0755"
max_file_size = 1099511627776 # 1 TB
enable_xattr = false
uid = 1000
gid = 1000mount_point = "/mnt/wormfs-fast"
[metadata]
database_path = "/nvme/wormfs/metadata.db"
read_pool_size = 32
cache_size_mb = 2000
enable_wal = true
synchronous = "Normal"
enable_foreign_keys = true
transaction_isolation = "ReadCommitted" # Less strict for performance
enable_prepared_statements = true
read_pool_timeout_secs = 120
[file_store]
disk_paths = [
"/nvme1/wormfs/chunks",
"/nvme2/wormfs/chunks"
]
max_chunk_size = 4194304 # 4 MB chunks
default_data_shards = 8
default_parity_shards = 3
max_concurrent_operations = 5000
verification_interval = 7200
orphan_cleanup_age = 86400
[filesystem]
node_id = 1
client_heartbeat_timeout = 86400
enable_read_locks = true
lock_timeout = 60
lock_extend_interval = 20
max_file_handles = 500000
inode_cache_size = 500000
inode_cache_ttl = 600 # 10 minutes
read_buffer_size = 16777216 # 16 MB
write_buffer_size = 16777216 # 16 MB
write_through = false
default_file_mode = "0644"
default_dir_mode = "0755"
max_file_size = 5497558138880 # 5 TB
enable_xattr = false
uid = 1000
gid = 1000For many small files (< 1 MB):
- Smaller
max_chunk_size(256 KB) - Larger
inode_cache_size - Moderate buffer sizes
For large files (> 100 MB):
- Larger
max_chunk_size(2-4 MB) - Larger buffer sizes (4-16 MB)
- More
data_shardsfor parallelism
write_through = falsesynchronous = "Normal"(not "Full")- Larger
write_buffer_size - More
max_concurrent_operations
- Larger
cache_size_mb - More
read_pool_size - Larger
inode_cache_size - Longer
inode_cache_ttl
- User Guide - Getting started with WormFS
- Troubleshooting - Common configuration issues
- Design Document - Architecture and internals