diff --git a/config.toml b/config.toml index 3d842fd..190db14 100644 --- a/config.toml +++ b/config.toml @@ -1,34 +1,39 @@ # WeaselDB Configuration File +# See config.md for complete documentation of all configuration options [server] -# Network interfaces to listen on - production config with just TCP +# Network interfaces where WeaselDB will accept connections +# Options: TCP (address + port) or Unix domain sockets (path) +# For production, use TCP. For local testing, consider Unix sockets for better performance interfaces = [ { type = "tcp", address = "127.0.0.1", port = 8080 } ] -# Maximum request size in bytes (for 413 Content Too Large responses) +# Maximum size allowed for incoming requests (larger requests are rejected) +# Increase if you need to handle very large transaction payloads max_request_size_bytes = 1048576 # 1MB -# Number of I/O threads for handling connections and network events +# Number of worker threads handling network connections +# Start with 1, increase if CPU usage is high under load io_threads = 1 -# Event batch size for epoll processing +# Internal network processing batch size +# Higher values may improve throughput at cost of latency event_batch_size = 32 [commit] -# Minimum length for request_id to ensure sufficient entropy +# Required minimum length for transaction request IDs +# Longer IDs reduce chance of accidental duplicates across clients min_request_id_length = 20 -# How long to retain request IDs for /v1/status queries (hours) +# How long to keep transaction status information available (hours) +# Used by status API to look up the outcome of completed transactions request_id_retention_hours = 24 -# Minimum number of versions to retain request IDs +# Alternative retention policy: keep transaction status for at least this many database versions +# Ensures status lookups work even during periods of low database activity request_id_retention_versions = 100000000 [subscription] -# Maximum buffer size for unconsumed data in /v1/subscribe (bytes) +# Memory limit for buffering change stream data per subscriber (bytes) +# Subscribers that fall behind will be disconnected when this limit is reached +# See api.md for details on the subscription streaming API max_buffer_size_bytes = 10485760 # 10MB -# Interval for sending keepalive comments to prevent idle timeouts (seconds) +# How often to send keep-alive messages to streaming subscribers (seconds) +# Prevents network timeouts during periods of no database activity keepalive_interval_seconds = 30 - -[benchmark] -# CPU-intensive loop iterations for /ok requests in resolve stage -# 0 = health check only (no CPU work) -# 4000 = default benchmark load (740ns CPU work, 1M req/s) -# Higher values = more CPU stress testing -ok_resolve_iterations = 0