Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too Many Open Files every once a day #2931

Closed
alileza opened this Issue Jul 11, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@alileza
Copy link
Contributor

alileza commented Jul 11, 2017

Every once a day my prometheus server crash because too many open files

  • System information:

Linux 4.4.0-83-generic x86_64

  • Prometheus version:

prometheus, version 1.5.0 (branch: master, revision: d840f2c)
build user: root@a04ed5b536e3
build date: 20170123-13:56:24
go version: go1.7.4

  • Alertmanager version:

    alertmanager, version 0.5.1 (branch: master, revision: 0ea1cac51e6a620ec09d053f0484b97932b5c902)
    build user: root@fb407787b8bf
    build date: 20161125-08:14:40
    go version: go1.7.3

  • Prometheus configuration file:

insert configuration here
  • Alertmanager configuration file:
insert configuration here (if relevant to the issue)
  • Logs:

screen_shot_2017-07-11_at_8_45_37_am

screen shot 2017-07-11 at 8 50 17 am

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jul 11, 2017

Practically, Prometheus just needs a good amount of file descriptors to do its work and simply raising your file descriptor limit for the process should solve the issue. There's no significant cost to raising the limit.

@alileza

This comment has been minimized.

Copy link
Contributor Author

alileza commented Jul 11, 2017

can we calculate the proper amount of file descriptor by metrics count? or just do a trial?

@gouthamve

This comment has been minimized.

Copy link
Member

gouthamve commented Jul 11, 2017

@alileza It largely depends on the number of targets you have and the scrape-interval. It requires the fds for the HTTP requests and for the database. If you have too many open-requests due to small scrape-interval or large number of targets, you can easily exhaust the default 1024 limit.

You could start with 4096 and increase it if you still see issues.

Closing this as it is not a Prometheus bug, please feel free to reopen if you think otherwise.

@gouthamve gouthamve closed this Jul 11, 2017

@alileza

This comment has been minimized.

Copy link
Contributor Author

alileza commented Jul 11, 2017

@gouthamve perfect, thank you !

@beorn7

This comment has been minimized.

Copy link
Member

beorn7 commented Jul 11, 2017

Just for the record: In all but the most extreme use cases, the vast majority of open fd's are created by leveldb. I guess those go up under heavier indexing load.

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 23, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.