What is the memory sizing recommendation for using AIStor Cache?

Asked by muratkars Answered by ugurtigli January 27, 2026
0 views

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:

  1. Metadata reads check the cache first before accessing disk
  2. Cache hits return metadata directly from RAM (microseconds vs milliseconds)
  3. Cache misses read from disk and populate the cache for future requests
  4. Cache is per-drive - each local drive gets its own cache allocation

Cache Flow:

OperationStep 1Step 2Step 3
ReadCheck cache for metadataOn hit → return cached dataOn miss → read from disk, populate cache
WriteWrite metadata to diskUpdate 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 GiB
Cache per Drive = 64 GiB / 16 drives = 4 GiB per drive

Configuration

Environment VariableDescriptionDefault
MINIO_CACHE_ENABLE[3]Enable drive cachingoff
MINIO_CACHE_SIZE[3]Total cache size (optional)25% of node memory

Enable cache with automatic sizing:

Terminal window
export MINIO_CACHE_ENABLE=on

Enable cache with custom size:

Terminal window
export MINIO_CACHE_ENABLE=on
export MINIO_CACHE_SIZE=32GiB

Note: 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:

ComponentMemory AllocationNotes
Base AIStor Process2 GiB per nodeReserved for distributed operations
GET Operations75% of remaining RAMSupports concurrent read requests
AIStor Cache25% of node memoryWhen enabled (optional)
OS and SystemRemainingKernel, buffers, other processes

Concurrent connections formula:

memory_limit = Available Memory × 75%
max_concurrent_requests = memory_limit ÷ 2 MiB

Where 2 MiB is twice the default erasure block size (1 MiB).[4][5]

Concurrent request capacity by RAM:

Available MemoryMemory Limit (75%)Max Concurrent Requests
8 GiB6 GiB3,072
16 GiB12 GiB6,144
32 GiB24 GiB12,288
64 GiB48 GiB24,576
128 GiB96 GiB49,152
256 GiB192 GiB98,304
512 GiB384 GiB196,608

Memory Sizing Recommendations

Without AIStor Cache

Deployment SizeMinimum RAMRecommended RAM
Small (dev/test)32 GiB64 GiB
Medium (production)128 GiB256 GiB
Large (high-throughput)256 GiB512 GiB

With AIStor Cache Enabled

Add 25% more memory to support the cache allocation:

Deployment SizeMinimum RAMRecommended RAM
Small (dev/test)40 GiB80 GiB
Medium (production)160 GiB320 GiB
Large (high-throughput)320 GiB640 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 rate
minio_system_drive_cache_hits / (minio_system_drive_cache_hits + minio_system_drive_cache_misses)
# Cache utilization
minio_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 GiB
At 75% allocation: 100 GiB / 0.75 = 133 GiB minimum

Step 2: Add cache overhead (25%)

With cache: 133 GiB / 0.75 = 177 GiB

Step 3: Add base process allocation

Total: 177 GiB + 2 GiB = 179 GiB minimum

Recommendation: Use 256 GiB RAM for headroom and OS requirements.

Cache allocation at 256 GiB:

Total cache: 256 GiB × 0.25 = 64 GiB
Per drive: 64 GiB / 16 = 4 GiB per drive

Summary

FactorConsideration
Base requirement2 GiB per node + concurrent connection needs
Cache overheadAdditional 25% when enabled
Minimum production256 GiB recommended
Cache sizingAutomatic (25%) or custom via MINIO_CACHE_SIZE
Workload fitBest for metadata-heavy, small object workloads

For detailed capacity planning assistance, contact your MinIO account team.


Source Code References
  1. cmd/xl-storage.go:130 - xlMetaCache *bigcache.BigCache (BigCache for xl.meta caching)
  2. cmd/server-main.go:695 - driveCacheMemLimit := (ctxt.MemLimit * 25) / 100 (25% memory allocation)
  3. internal/config/constants.go:82-83 - EnvCache = "MINIO_CACHE_ENABLE" and EnvCacheSize = "MINIO_CACHE_SIZE"
  4. cmd/object-api-common.go:31 - blockSizeV2 = 1 * humanize.MiByte (1 MiB block size)
  5. cmd/handler-api.go:134-135 - ram_per_request is 2 * 1MiB (default erasure block size v2)
  6. cmd/metrics-v3-system-drive.go:69-75 - Cache metrics definitions (cache_capacity, cache_used, cache_hits, cache_misses, cache_collisions)
0