Prometheus only keeps up to 2 hours in memory. After this it is always written to disk and mmaped. There are no controls for this. The local retention time makes (almost) no difference to memory use.
The only control is to reduce the metrics collected. On Tue, Apr 14, 2020, 12:33 Thomas Will <[email protected]> wrote: > Hello guys, I am running my Prometheus in a docker container, have set my > retention period to be 2days and also enabled Thanos at the back. I have > two questions:- > > 1) For how much time Prometheus stores its metrics in ram and after that > sends to the disc? > 2) Is there any way to control our ram usage, like based on size or number > of metrics, i.e. if ram size increases beyond a threshold, dump the data to > the disc. > > Cheers, all. > Thomas Will. > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/prometheus-users/1a166fbc-3c49-45b4-9dec-361f07f20172%40googlegroups.com > <https://groups.google.com/d/msgid/prometheus-users/1a166fbc-3c49-45b4-9dec-361f07f20172%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CABbyFmqNiLDQ2ot2ed9Ae_E7MRmfqw5CJNunKsWGYZTGSTrxRQ%40mail.gmail.com.

