Configuration
Configuration
TagCache is designed to work well with minimal configuration, but offers extensive customization options for advanced use cases.
Configuration File Location
TagCache looks for configuration files in the following locations (in order):
- File specified by
--configcommand line argument ./tagcache.conf(current directory)- Platform-specific default locations:
- Linux:
/etc/tagcache/tagcache.conf - macOS:
/opt/homebrew/etc/tagcache.confor/usr/local/etc/tagcache.conf - Windows:
C:\ProgramData\tagcache\tagcache.conf
- Linux:
Generating a Sample Configuration
| |
Complete Configuration Reference
| |
Environment Variables
Configuration values can be overridden using environment variables with the prefix TAGCACHE_:
| |
Command Line Arguments
Many configuration options can be specified via command line:
| |
Configuration Sections
Server Configuration
Controls network binding and server behavior:
| |
Authentication
Configure user authentication:
| |
Security Warning: Always change the default credentials in production!
Cache Configuration
Memory and cache behavior settings:
| |
Eviction Policies:
lru: Least Recently Used (recommended)lfu: Least Frequently Usedrandom: Random evictionnone: No eviction (may cause OOM)
Performance Tuning
Optimize for your workload:
| |
Tuning Guidelines:
- Increase
num_shardsfor high concurrency (256-1024) - Decrease
cleanup_interval_msfor more frequent cleanup - Adjust pool sizes based on expected load
Security Settings
Configure security features:
| |
Production Configuration Examples
High-Performance Setup
| |
Security-Focused Setup
| |
Memory-Constrained Setup
| |
Validation
Validate your configuration before starting:
| |
Dynamic Configuration
Some settings can be updated at runtime via the HTTP API:
| |
Best Practices
- Security: Always change default credentials
- Memory: Set appropriate memory limits for your system
- Sharding: Use more shards for high-concurrency workloads
- Monitoring: Enable metrics and health checks
- Logging: Use appropriate log levels for production
- Backup: Keep configuration files in version control
Configuration changes require a server restart unless they support dynamic updates.