Configuration
Performance Tuning
Optimize milmil for production workloads.
Redis Cache
Redis is optional but strongly recommended for production. Without Redis, milmil uses an in-memory cache that doesn't persist across restarts.
REDIS_URL=redis://localhost:6379Sizing Recommendations
| Library Size | Recommended Redis Memory |
|---|---|
| < 500 anime | 64 MB |
| 500–2000 anime | 256 MB |
| 2000+ anime | 512 MB+ |
Transcoding
Hardware Acceleration
Hardware acceleration significantly reduces CPU usage during transcoding. Without it, a single 1080p transcode stream can use 100% of a CPU core.
milmil supports FFmpeg hardware acceleration backends:
| Backend | Description |
|---|---|
| VAAPI | Video Acceleration API (Intel, AMD on Linux) |
| NVENC | NVIDIA GPU encoding |
| QSV | Intel Quick Sync Video |
| VideoToolbox | macOS hardware acceleration |
For Docker, pass through the GPU device:
# NVIDIA
devices:
- /dev/nvidia0:/dev/nvidia0
- /dev/nvidiactl:/dev/nvidiactl
# Intel VAAPI
devices:
- /dev/dri:/dev/driQuality Presets
| Preset | Use Case | CPU Usage |
|---|---|---|
ultrafast | Low-power devices (RPi) | Minimal |
fast | Balanced quality/speed | Moderate |
medium | Default — good quality | High |
Database Tuning
For large libraries, tune PostgreSQL:
-- Connection pool (set in DATABASE_URL)
-- ?pool_max_conns=20&pool_min_conns=5
-- Recommended postgresql.conf tweaks
shared_buffers = 256MB
effective_cache_size = 1GB
work_mem = 16MB