# netdata.conf for db size on a Docker container?

**URL:** <https://community.netdata.cloud/t/netdata-conf-for-db-size-on-a-docker-container/7085>\
**Category:** Help\
**Tags:** configuration, agent, dbengine\
**Created:** [January 12, 2025, 1:34pm UTC](https://community.netdata.cloud/t/netdata-conf-for-db-size-on-a-docker-container/7085 "2025-01-12T13:34:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jan\_reinhardt](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/jan_reinhardt/32/4285_2.png) [@jan\_reinhardt](https://community.netdata.cloud/u/jan_reinhardt)\
**Post date:** [January 12, 2025, 1:34pm UTC](https://community.netdata.cloud/t/netdata-conf-for-db-size-on-a-docker-container/7085/1 "2025-01-12T13:34:34Z")

</div>

## Problem/Question

My database is growing in size, Id like to keep it small.  
How do I best do this on my Docker install? Edit what conf file, do another volume mount within Docker?

## Relevant docs you followed/actions you took to solve the issue

I have read

> **[Database Configuration Reference | Learn Netdata](https://learn.netdata.cloud/docs/netdata-agent/configuration/database)**
>
> With a single configuration change, the Netdata Agent can store days, weeks, or months of metrics at its famous per-second granularity.

So the default for 3 tiers is 3 GB size? Id like to size down, just keep a DB history for one or maybe two weeks.

## Environment/Browser/Agent’s version etc

Docker container from [hub.docker.com](http://hub.docker.com)  
netdata/netdata:latest  
running on a Raspberry Pi 5

## What I expected to happen

Have my netdata install resize its DB tiers, so daily backups will shrink in size, too

Thank you!

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [January 13, 2025, 8:32am UTC](https://community.netdata.cloud/t/netdata-conf-for-db-size-on-a-docker-container/7085/2 "2025-01-13T08:32:55Z")

</div>

> [@jan\_reinhardt](#):
>
> So the default for 3 tiers is 3 GB size? Id like to size down, just keep a DB history for one or maybe two weeks.

Hi. Could you please elaborate on the specific issue you’re encountering? It is [very straightforward](https://learn.netdata.cloud/docs/netdata-agent/configuration/database#tiers).

---

<div class="post-metadata">

**Author:** ![jan\_reinhardt](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/jan_reinhardt/32/4285_2.png) [@jan\_reinhardt](https://community.netdata.cloud/u/jan_reinhardt)\
**Post date:** [January 13, 2025, 10:23am UTC](https://community.netdata.cloud/t/netdata-conf-for-db-size-on-a-docker-container/7085/3 "2025-01-13T10:23:32Z")

</div>

Sure / sorry.  
On my Docker install, I have a volume mount for /etc/netdata.  
Within this directory, there is a file called `netdata.conf` :

```auto
# netdata can generate its own config which is available at 'http://<IP>:19999/netdata.conf'
# You can download it using:
# curl -o //etc/netdata/netdata.conf http://localhost:19999/netdata.conf
# or
# wget -O //etc/netdata/netdata.conf http://localhost:19999/netdata.conf

```

= it’s an empty file. Is this the right file to alter the storage tiers?  
Will one setting in this file do the trick for me?  
I.e.

```auto

[db]
    mode = dbengine
    storage tiers = **2**

    # Tier 0, per second data. Set to 0 for no limit.
    dbengine tier 0 retention size = 1GiB
    dbengine tier 0 retention time = **7d**

    # Tier 1, per minute data. Set to 0 for no limit.
    dbengine tier 1 retention size = 1GiB
    dbengine tier 1 retention time = **14d**

    # Tier 2, per hour data. Set to 0 for no limit.
    #dbengine tier 2 retention size = 1GiB
    #dbengine tier 2 retention time = 2y

```

Thanks for helping, @ilyam8

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [January 13, 2025, 10:39am UTC](https://community.netdata.cloud/t/netdata-conf-for-db-size-on-a-docker-container/7085/4 "2025-01-13T10:39:04Z")

</div>

> Is this the right file to alter the storage tiers?

Yes. But your syntax is wrong. Why did you add `**` for time retention values? If you need only time-based (e.g. 1 week):

```auto
[db]
    mode = dbengine
    storage tiers = 1

    # Tier 0, per second data. Set to 0 for no limit.
    dbengine tier 0 retention size = 0
    dbengine tier 0 retention time = 7d

```

Just read the [retention settings](https://learn.netdata.cloud/docs/netdata-agent/configuration/database#retention-settings) for details.

---

<div class="post-metadata">

**Author:** ![jan\_reinhardt](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/jan_reinhardt/32/4285_2.png) [@jan\_reinhardt](https://community.netdata.cloud/u/jan_reinhardt)\
**Post date:** [January 13, 2025, 11:19am UTC](https://community.netdata.cloud/t/netdata-conf-for-db-size-on-a-docker-container/7085/5 "2025-01-13T11:19:58Z")

</div>

sorry, the \*\* were added by the forum software because I marked it as **bold**

I will try it like that now. I was confused before, because my .conf file will have this setting only, nothing else. I was expecting to modify a .conf file with lots more in it.
