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 upPrometheus on a docker container gets OOM Killed #1358
Comments
beorn7
added
the
question
label
Feb 1, 2016
This comment has been minimized.
This comment has been minimized.
|
40960 memory chunks should lead to at most 200MiB of RAM usage. With 3GiB, you should be fine with many more, like 500,000 or even 1,000,000 chunks (especially if using recent versions like 0.16.2). Could you check how much memory chunks your server is actually using (metric If you have many time series, the Prometheus server has to keep a couple of chunks for each in memory anyway, so let's say you have 1M time series, than your server needs to keep 1 to 2M chunks in memory to be operational, no matter what you have set as flags. (From version 0.17 on, the server will stop ingestion in that case, so you will definitely notice. ;) In that case, it will exceed the 3GiB it is allowed to use and get OOM-killed. |
This comment has been minimized.
This comment has been minimized.
|
prometheus_local_storage_memory_chunks 729095 This is how many I have right now. The process is running with: I had done a typo earlier. Im actually running with 10240 local.memory.chunks yet still im running on 99% memory consistently. Docker stats: |
This comment has been minimized.
This comment has been minimized.
|
If you have 700k chunks in memory, that indicates that you likely have a
|
This comment has been minimized.
This comment has been minimized.
|
prometheus_local_storage_memory_series 729095 I would doubt the query count as Im hardly executing any queries on the prometheus server. |
This comment has been minimized.
This comment has been minimized.
|
Yup, so your Prometheus has 729095 active time series. Prometheus keeps at First of all, I would double-check your actual service metrics (label On Tue, Feb 2, 2016 at 2:23 AM, Vijay Samuel notifications@github.com
|
This comment has been minimized.
This comment has been minimized.
|
So yes, with 729095 you want at least ~2M memory chunks and thus ~6GiB of RAM. Either get more RAM or cut down the number of metrics your monitored targets are exporting. |
beorn7
closed this
Feb 2, 2016
This comment has been minimized.
This comment has been minimized.
|
Thank you so much for the help. This helped me in understanding how to debug memory issues on prometheus. Is this documented anywhere? I could submit a PR on documenting this as it would be useful for the next person. |
This comment has been minimized.
This comment has been minimized.
|
@vjsamuel Yes, it is documented here: http://prometheus.io/docs/operating/storage/ |
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 24, 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. |
vjsamuel commentedJan 30, 2016
I currently face the issue that, Im running a docker container with prometheus on kubernetes. I've allocated a maximum of 3G of memory. The process is started with the following command:
prometheus -config.file=/etc/prometheus/prometheus.yml -storage.local.path=/prometheus -web.console.libraries=/etc/prometheus/console_libraries -web.console.templates=/etc/prometheus/consoles -storage.local.memory-chunks=40960 -storage.local.max-chunks-to-persist=10240 -storage.local.retention=720h
I see that the container gets OOMKilled because the container consumes all 3G and tries to consume more. Is there some setting Im going wrong with? Reducing the memory.chunks to 10240 has given me a longer life but still the container runs with 99% memory utilization.
Can someone please guide me on this issue at hand?
Thanks in advance.