Prometheus v2.24 Memory Leak

272 views
Skip to first unread message

Shubham Shrivastav

unread,
Jul 27, 2021, 11:04:43 PM7/27/21
to Prometheus Users
I've deployed Prometheus using helm chart https://github.com/prometheus-community/helm-charts

The RAM utilization keeps on increasing slowly over a couple of days.

TSDB Status
Head Stats
Number of Series 111147
Number of Chunks 123102
2021-07-28T02:00:00.080Z (1627437600080)
2021-07-28T03:00:29.028Z (1627441229028)

NameCount
apiserver_request_duration_seconds_bucket
15808
etcd_request_duration_seconds_bucket
4344
container_tasks_state
2330
apiserver_response_sizes_bucket
2168
container_memory_failures_total
1864
promtail_log_entries_bytes_bucket
1800
kubelet_runtime_operations_duration_seconds_bucket
1272
kube_pod_container_status_waiting_reason
1239
storage_operation_duration_seconds_bucket
1218
kube_pod_container_status_last_terminated_reason
1062

I'm not sure what the problem is. 
Help appreciated

TIA
Shubham 
image-2.png

Ben Kochie

unread,
Jul 28, 2021, 6:37:13 AM7/28/21
to Shubham Shrivastav, Prometheus Users
What is the graph for go_memstats_alloc_bytes{job="prometheus"}?

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/bd288ed2-b3bc-4c33-b41e-50a6142878a5n%40googlegroups.com.

Shubham Shrivastav

unread,
Jul 28, 2021, 10:31:33 PM7/28/21
to Prometheus Users
Here it is for a period of a week
Dont see much of a jump here
Screen Shot 2021-07-28 at 7.29.09 PM.png

Ben Kochie

unread,
Jul 29, 2021, 12:49:46 AM7/29/21
to Shubham Shrivastav, Prometheus Users
Sounds like this is page cache use, not actual use. That is not a memory leak, just the kernel doing normal memory management.

Shubham Shrivastav

unread,
Jul 29, 2021, 12:07:52 PM7/29/21
to Prometheus Users
Then why does RAM consumption keep on increasing?

Shubham Shrivastav

unread,
Jul 31, 2021, 4:24:54 AM7/31/21
to Prometheus Users
Update: 

Kubectl top gives me 
CPU : 141m
Memory: 292Mi

Is the graph wrong?


Ben Kochie

unread,
Jul 31, 2021, 5:20:56 AM7/31/21
to Shubham Shrivastav, Prometheus Users
It's not wrong, it just doesn't matter. Cached data sits in memory until the memory is needed for other work.

Shubham Shrivastav

unread,
Jul 31, 2021, 5:30:34 AM7/31/21
to Prometheus Users
Not sure I understand. 
“Cached data sits in memory” > you mean Prometheus will keep on consuming more RAM until it runs out of it?

Ben Kochie

unread,
Jul 31, 2021, 5:53:19 AM7/31/21
to Shubham Shrivastav, Prometheus Users
No, the memory is in the Prometheus process, it's part of the kernel page cache. It's "assigned" to the container, which is why it looks like the container is using more memory.

But it's page cache, so it doesn't matter. Please read some Linux documentation on how memory management works.

Reply all
Reply to author
Forward
0 new messages