AIStor Cache is an optional in-memory metadata caching feature that improves read performance by reducing disk I/O for object metadata lookups. Understanding the memory requirements helps you properly size your nodes.
Answer
How AIStor Cache Works
AIStor Cache uses BigCache[1] (a high-performance, in-memory key-value (KV) store library written in Go) to cache xl.meta metadata for objects on each drive. When enabled:
- Metadata reads check the cache first before accessing disk
- Cache hits return metadata directly from RAM (microseconds vs milliseconds)
- Cache misses read from disk and populate the cache for future requests
- Cache is per-drive - each local drive gets its own cache allocation
Cache Flow:
| Operation | Step 1 | Step 2 | Step 3 |
|---|---|---|---|
| Read | Check cache for metadata | On hit → return cached data | On miss → read from disk, populate cache |
| Write | Write metadata to disk | Update cache with new data | — |
What gets cached:
- Object metadata (xl.meta files)
- NOT object data itself
Benefits:
- Reduced disk I/O for metadata-heavy workloads
- Lower latency for object listings and HEAD operations
- Improved performance for small object workloads with frequent metadata access
Memory Allocation Formula
When AIStor Cache is enabled, memory is allocated as follows:
Cache Memory per Drive = (Total Cache Memory) / (Number of Local Drives)Default behavior (automatic):[2]
Total Cache Memory = Node Memory × 25%Example with 256 GiB RAM and 16 drives:
Total Cache Memory = 256 GiB × 0.25 = 64 GiBCache per Drive = 64 GiB / 16 drives = 4 GiB per driveConfiguration
| Environment Variable | Description | Default |
|---|---|---|
MINIO_CACHE_ENABLE[3] | Enable drive caching | off |
MINIO_CACHE_SIZE[3] | Total cache size (optional) | 25% of node memory |
Enable cache with automatic sizing:
export MINIO_CACHE_ENABLE=onEnable cache with custom size:
export MINIO_CACHE_ENABLE=onexport MINIO_CACHE_SIZE=32GiBNote: If MINIO_CACHE_SIZE exceeds 25% of node memory, AIStor ignores the specified value and uses the automatic calculation instead.
Total Node Memory Calculation
To calculate total memory requirements per node, consider these components:
| Component | Memory Allocation | Notes |
|---|---|---|
| Base AIStor Process | 2 GiB per node | Reserved for distributed operations |
| GET Operations | 75% of remaining RAM | Supports concurrent read requests |
| AIStor Cache | 25% of node memory | When enabled (optional) |
| OS and System | Remaining | Kernel, buffers, other processes |
Concurrent connections formula:
memory_limit = Available Memory × 75%max_concurrent_requests = memory_limit ÷ 2 MiBWhere 2 MiB is twice the default erasure block size (1 MiB).[4][5]
Concurrent request capacity by RAM:
| Available Memory | Memory Limit (75%) | Max Concurrent Requests |
|---|---|---|
| 8 GiB | 6 GiB | 3,072 |
| 16 GiB | 12 GiB | 6,144 |
| 32 GiB | 24 GiB | 12,288 |
| 64 GiB | 48 GiB | 24,576 |
| 128 GiB | 96 GiB | 49,152 |
| 256 GiB | 192 GiB | 98,304 |
| 512 GiB | 384 GiB | 196,608 |
Memory Sizing Recommendations
Without AIStor Cache
| Deployment Size | Minimum RAM | Recommended RAM |
|---|---|---|
| Small (dev/test) | 32 GiB | 64 GiB |
| Medium (production) | 128 GiB | 256 GiB |
| Large (high-throughput) | 256 GiB | 512 GiB |
With AIStor Cache Enabled
Add 25% more memory to support the cache allocation:
| Deployment Size | Minimum RAM | Recommended RAM |
|---|---|---|
| Small (dev/test) | 40 GiB | 80 GiB |
| Medium (production) | 160 GiB | 320 GiB |
| Large (high-throughput) | 320 GiB | 640 GiB |
MinIO’s general recommendation: At least 256 GiB of RAM per host for production deployments.
When to Enable AIStor Cache
Enable cache when:
- Workload is metadata-heavy (frequent listings, HEAD requests)
- Many small objects with repeated access patterns
- Sufficient RAM available beyond concurrent connection needs
- Disk latency is a bottleneck for metadata operations
Keep cache disabled when:
- Memory is constrained
- Workload is primarily large sequential reads/writes
- Objects are accessed infrequently (cold storage)
Monitoring Cache Effectiveness
Use these v3 metrics[6] to monitor cache performance:
# Cache hit rateminio_system_drive_cache_hits / (minio_system_drive_cache_hits + minio_system_drive_cache_misses)
# Cache utilizationminio_system_drive_cache_used / minio_system_drive_cache_capacity
# Cache collisions (evictions due to hash conflicts)rate(minio_system_drive_cache_collisions[5m])Target metrics:
- Hit rate > 80% indicates effective caching
- Utilization near 100% may indicate cache is undersized
- High collision rate suggests cache size should be increased
Example: Sizing a Production Node
Scenario:
- 16 NVMe drives per node
- Expected 50,000 concurrent connections
- Want to enable AIStor Cache
Step 1: Calculate memory for concurrent connections
Required for connections = 50,000 × 2 MiB = 100 GiBAt 75% allocation: 100 GiB / 0.75 = 133 GiB minimumStep 2: Add cache overhead (25%)
With cache: 133 GiB / 0.75 = 177 GiBStep 3: Add base process allocation
Total: 177 GiB + 2 GiB = 179 GiB minimumRecommendation: Use 256 GiB RAM for headroom and OS requirements.
Cache allocation at 256 GiB:
Total cache: 256 GiB × 0.25 = 64 GiBPer drive: 64 GiB / 16 = 4 GiB per driveSummary
| Factor | Consideration |
|---|---|
| Base requirement | 2 GiB per node + concurrent connection needs |
| Cache overhead | Additional 25% when enabled |
| Minimum production | 256 GiB recommended |
| Cache sizing | Automatic (25%) or custom via MINIO_CACHE_SIZE |
| Workload fit | Best for metadata-heavy, small object workloads |
For detailed capacity planning assistance, contact your MinIO account team.
Source Code References
cmd/xl-storage.go:130-xlMetaCache *bigcache.BigCache(BigCache for xl.meta caching)cmd/server-main.go:695-driveCacheMemLimit := (ctxt.MemLimit * 25) / 100(25% memory allocation)internal/config/constants.go:82-83-EnvCache = "MINIO_CACHE_ENABLE"andEnvCacheSize = "MINIO_CACHE_SIZE"cmd/object-api-common.go:31-blockSizeV2 = 1 * humanize.MiByte(1 MiB block size)cmd/handler-api.go:134-135-ram_per_request is 2 * 1MiB (default erasure block size v2)cmd/metrics-v3-system-drive.go:69-75- Cache metrics definitions (cache_capacity, cache_used, cache_hits, cache_misses, cache_collisions)