Prometheus logs `too many open files`
IntermediateTroubleshootingPrometheus storage, memory and cardinality
Answer
Likely causes → The process file descriptor limit is too low for the number of blocks, WAL segments and scrape connections.
Diagnose →
cat /proc/$(pgrep prometheus)/limits | grep 'open files'
ls /proc/$(pgrep prometheus)/fd | wc -l
process_open_fds / process_max_fds
Fix → Set LimitNOFILE=65536 in the systemd unit or raise container ulimits.
Prevent → Alert on process_open_fds / process_max_fds > 0.8.
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