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

After restart Prometheus, it try to dump all tsdb data to memory - prometheus-2.0 #2917

Closed
tinytub opened this Issue Jul 7, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@tinytub
Copy link

tinytub commented Jul 7, 2017

What did you do?
Try to benchmark prometheus 2.0.0-alpha-3
and set prometheus scrape-interval to 1s , then scrape 6 test host and they have tatal 50w samples .
After one hour, prometheus still scrape, but memory use is about 12g and still raise.
I killed prometheus and try to restart it, the main process is start,
log stop at "INFO[0000] Starting tsdb source="main.go:210""
it looks like prometheus try to dump all tsdb data to memory, after 30 minutes, prometheus memory res usage is about 33g, and my prometheus data dir is same size.
image
image

finally after another 10 minutes I got "tsdb started" log ,but the memory usage not go down

Environment

  • System information:

Linux 2.6.32-642.15.1.el6.x86_64 x86_64

  • Prometheus version:

prometheus, version 2.0.0-alpha.3 (branch: master, revision: 70f96b0)
build user: root@5630fb1ab539
build date: 20170622-10:04:46
go version: go1.8.3

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jul 7, 2017

they have tatal 50w samples

What does that mean?

What are you scraping from these host in general. By default we keep the last 4h in memory. At 1s scrape intervals that naturally has implications for the memory consumed in total.

At this interval you should probably set --storage.tsdb.min-block-duration to a value like 5m. I would also recommend building from the dev-2.0 branch's HEAD as some issues were fixed in the meantime.

@tinytub

This comment has been minimized.

Copy link
Author

tinytub commented Jul 7, 2017

total 500000 metrics,
I edit the example in https://github.com/prometheus/client_golang
Then I can get about 80000 metrics from every host.

Thanks for the help, I'll try it

@tinytub tinytub closed this Jul 9, 2017

@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.