Keydb.cfg | ((full))
Use both RDB (for backups) and AOF (for durability). Set appendfsync everysec for balance. 7. Security Directives | Directive | Default | Description | |-----------|---------|-------------| | requirepass | (empty) | Password for AUTH command. | | masterauth | (empty) | Password for replica → master auth. | | rename-command | (none) | Disable or rename dangerous commands (e.g., FLUSHALL ). | | aclfile | (none) | External ACL configuration file (KeyDB 6+). |
| Directive | Default | Description | |-----------|---------|-------------| | server-threads | 2 | Number of threads for handling client requests. | | server-thread-affinity | (none) | CPU core binding for server threads (e.g., 0-3 ). | | io-threads | 1 | Threads for I/O operations (reads/writes). | | io-threads-do-reads | no | Whether I/O threads also handle read commands. | | async-flush | no | Perform flush operations asynchronously. | | async-flush-threads | 4 | Threads for async flush. | keydb.cfg
For production, bind to specific internal IPs, enable keepalive, and set a reasonable timeout. 4. Threading Model (KeyDB-Specific) This is the core differentiator from Redis. Use both RDB (for backups) and AOF (for durability)
Increasing server-threads improves throughput on multi-core systems but may increase complexity. Start with cores/2. 5. General Operational Directives | Directive | Default | Description | |-----------|---------|-------------| | daemonize | no | Run as background process. | | pidfile | /var/run/keydb.pid | PID file location. | | loglevel | notice | Levels: debug, verbose, notice, warning. | | logfile | "" | Log file path. Empty = stdout. | | syslog-enabled | no | Log to syslog. | | databases | 16 | Number of logical databases. | | always-show-logo | no | Show KeyDB logo on startup. | | supervised | no | Integration with systemd/upstart. | 6. Persistence Options KeyDB supports both RDB snapshots and AOF (Append-Only File), exactly like Redis. 6.1 RDB (Snapshotting) | Directive | Example | Meaning | |-----------|---------|---------| | save | save 900 1 | Save if ≥1 key changed in 900 sec. | | save | save 300 10 | Save if ≥10 keys changed in 300 sec. | | stop-writes-on-bgsave-error | yes | Stop writes if background save fails. | | rdbcompression | yes | Compress string objects using LZF. | | rdbchecksum | yes | CRC64 checksum at end of RDB. | | dbfilename | dump.rdb | RDB file name. | | dir | ./ | Directory for RDB/AOF files. | 6.2 AOF (Append-Only File) | Directive | Default | Description | |-----------|---------|-------------| | appendonly | no | Enable AOF persistence. | | appendfilename | appendonly.aof | AOF file name. | | appendfsync | everysec | always , everysec , no . | | no-appendfsync-on-rewrite | no | Avoid fsync during rewrite. | | auto-aof-rewrite-percentage | 100 | Trigger rewrite if file grows 100%. | | auto-aof-rewrite-min-size | 64mb | Minimum size for rewrite. | | aof-load-truncated | yes | Load truncated AOF (on crash recovery). | | aof-use-rdb-preamble | yes | Use RDB at start of AOF (hybrid format). | Security Directives | Directive | Default | Description













