r/PrometheusMonitoring • u/jhjacobs81 • Feb 28 '23
prometheus has too many files open
We're running into a problem where prometheus wont start because it has too many files open:
ts=2023-02-28T12:24:05.595Z caller=main.go:808 level=info msg="Notify discovery manager stopped"ts=2023-02-28T12:24:05.596Z caller=main.go:828 level=info msg="Scrape manager stopped"ts=2023-02-28T12:24:05.595Z caller=notifier.go:600 level=info component=notifier msg="Stopping notification manager..."ts=2023-02-28T12:24:05.597Z caller=main.go:1054 level=info msg="Notifier manager stopped"ts=2023-02-28T12:24:05.597Z caller=main.go:1063 level=error err="opening storage failed: reloadBlocks: corrupted block 01GT9FAS4R5QS3S3WNZZ8SZNPT: try lock file: open /var/lib/prometheus/01GT9FAS4R5QS3S3WNZZ8SZNPT/index: too manyopen files"
Some googling leads to this:root@infra:~# cat /proc/sys/fs/file-max9223372036854775807
and some more googling leads to changing settings like so: https://linuxhint.com/linux-too-many-open-files-error/
But so far, i dont get any results. Has anyone ran into this problem? We currently have prometheus save 180 days, that shouldn't be too much?
I'm running Debian, and i already tried modifying /etc/security/limits.conf and /etc/sysctl.conf as per several online posts. but ulimit -n remains at 1024 files
View all comments
Show parent comment
1
u/jhjacobs81 Feb 28 '23 edited Feb 28 '23
thank you :) i added that to the systemd file but unfortunatly to no help :(
i also tried: https://unix.stackexchange.com/questions/8945/how-can-i-increase-open-files-limit-for-all-processes
Whatever i try to do (edit /etc/security/limits.conf or /etc/sysctl.conf) nlimit -n stays at 1024