Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upconfig reloads cause huge increase in memory #3858
Comments
This comment has been minimized.
This comment has been minimized.
|
I should add I've noticed this on 2.1.0 as well. It causes OOMs once prometheus has enough data. |
This comment has been minimized.
This comment has been minimized.
|
This is expected when you change your target labels, we need to create new chunks for all the new metrics. |
This comment has been minimized.
This comment has been minimized.
|
@brian-brazil That's understandable, but I'm not changing any target labels in this scenario. The only thing i updated was the global scrape timeout (i had nothing timing out before i just wanted to prove this is why it was increasing). |
This comment has been minimized.
This comment has been minimized.
|
In that case this was probably coincidental, 15M new chunks is going to take ~15GB of RAM. That's what the graphs you originally had in this bug indicates to me. |
This comment has been minimized.
This comment has been minimized.
|
@brian-brazil the reason I removed that graph is I've since run it a couple more times and don't see a correlation between memory chunks increasing and the memory increase during a reload. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This is probably caused by re-creating all scrape loops on reload: Lines 223 to 239 in 404b306 In the past this was fairly un-invasive as loops didn't hold any meaningful memory state. But now we actually keep rather big caches per loop for our scrape performance optimisations. I think it should be safe to hand over the entire scrape cache object to the new loop and thus avoiding the whole issue. But it needs some careful consideration. |
krasi-georgiev
referenced this issue
Feb 19, 2018
Open
scrape: pass scrape cache to replacement loops #3861
This comment has been minimized.
This comment has been minimized.
|
Closing it as a duplicate of #3112. |
simonpasquier
closed this
Sep 6, 2018
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 22, 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. |


jhorwit2 commentedFeb 17, 2018
•
edited
What did you do?
I updated the config in a way that should not noticeably impact cpu/memory (updated the scrape timeout from 5s to 10s).
What did you expect to see?
I expected the scrape timeout to increase, which it did and I expected CPU/memory usage to remain the same.
What did you see instead? Under which circumstances?
Memory spikes at reload time
I've noticed this happen with any config change as did the memory usage. The series created/removed and appended samples per second had no fluctuation.
Environment
Running the prometheus 2.2.0-RC0 docker container from dockerhub
Host is
Linux 4.1.12-112.14.13.el7uek.x86_64 x86_64