Loki Best Practices?

Hi Community,

Just wanted to ask… what is the average duration that Loki is meant to keep logs for?

Is it meant to keep logs for 5 years sort of thing? (long term history) or just around 1 day (super short term use?)

If you use an object storage as backend (such as S3) I don’t see why you can’t have a longer retention.

We use 180-day retention by default for our own cluster, I know some other community members with much longer retention.

I see, ive always been under the impression that Loki is meant to be used for 14 days or so. Good to know it can be kept for longer!

In this case, how many TB can Loki handle on average?

We installed Loki using the Docker Image readily available. I cant tell what db its installed with…

That depends. Loki is very scalable, you’ll need to do some performance test for yourself. If you are using S3 as storage you can store as much data in there as you want, but you’ll of course need to scale Loki writers and readers according to your traffic.

Sorry to jump in, but according to the documentation simple scalable deployment of Loki should be able to handle up to TBs per day:

The simple scalable deployment mode can scale up to a few TBs of logs per day,

See doc here: Loki deployment modes | Grafana Loki documentation

If you’re around the 20Gbs of logs per day, a monolithic deployment should work just fine.

Regarding your db, it depends on your configuration file and how you configured it.

1 Like