Thanos Store Gateway is OOMKilled on startup
AdvancedTroubleshootingPrometheus storage, memory and cardinality
Answer
Likely causes → It loads index headers for every block in a large bucket, or blocks were never downsampled/compacted.
Diagnose → Count blocks with thanos tools bucket inspect; check thanos_bucket_store_blocks_loaded.
Fix → Shard stores by time (--min-time=-30d --max-time=-2d) or by hash relabel, enable compactor downsampling, give the store fast local disk for index-header cache.
Prevent → Keep the compactor healthy; it is the main lever on store memory.
More on Prometheus storage, memory and cardinality
Prometheus pod restarts with `OOMKilled` every few hoursIntermediateA query fails with `query processing would load too many samples into memory in query execution`IntermediateHead series jumped from 2M to 9M after a deployAdvancedPrometheus logs `opening storage failed: ... unexpected EOF` / `corruption in segment` and won't startAdvancedPrometheus is in CrashLoopBackOff with `no space left on device`BeginnerPrometheus takes 15 minutes to become ready after a restartAdvanced