Netdata: Question about /var/db/netdata

Created on 30 Jan 2017  路  3Comments  路  Source: netdata/netdata

Hi maintainer(s),

So, given the long thread over in https://forums.freenas.org/index.php?threads/grafana-or-netdata-which-do-you-prefer.49985 I have decided to at least try and see how much work netdata might be to integrate into FreeNAS as an "optional service" (we have a service UI that can be used to turn services on and off). The integration of the port went easily enough, though netdata needing its own user and group was kind of a pain since this requires adding the role accounts to our factory.json file, but no big deal, however now we're a bit stuck in trying to figure out why netdata also needs a /var/db/netdata directory and writes into it.

So far, of the dozen or so services we support, only Samba has needed a scratch directory on our flash boot media for keeping its Domain Controller database and a few other persistent bits of data. This would make netdata the second, and potentially of concern since most FreeNAS users boot from USB boot media which is usually allergic to a lot of write I/O (cheap flash, poor wear leveling). It's always possible to move the system dataset to a ZFS pool, which is generally what we recommend, but that comes with other costs - anything writing to THAT system dataset now keeps the drives from spinning down, which has power savings implications, so users generally aren't happy with that, either.

Question: Is the data in /var/db/netdata strictly necessary, or can we turn that behavior off?

Thanks.

question

Most helpful comment

No, this is not necessary. You can add this line to etc/netdata/netdata.conf

memory mode = ram

For the full description see
https://github.com/firehol/netdata/wiki/Memory-Requirements#memory-modes

It's always possible to move the system dataset to a ZFS pool, which is generally what we recommend, but that comes with other costs - anything writing to THAT system dataset now keeps the drives from spinning down, which has power savings implications

With the default setting netdata only writes to /var/db/netdata on exit. So this might not be a problem either.

All 3 comments

No, this is not necessary. You can add this line to etc/netdata/netdata.conf

memory mode = ram

For the full description see
https://github.com/firehol/netdata/wiki/Memory-Requirements#memory-modes

It's always possible to move the system dataset to a ZFS pool, which is generally what we recommend, but that comes with other costs - anything writing to THAT system dataset now keeps the drives from spinning down, which has power savings implications

With the default setting netdata only writes to /var/db/netdata on exit. So this might not be a problem either.

Keep also in mind you don't need a user for netdata.

You can add in /etc/netdata/netdata.conf several options:

[global]
    # update once per second
    update every = 1

    # keep one 1 hour of data in RAM
    history = 3600

    # any user you like
    run as user = root

    # any user/group here too
    # chown /usr/share/netdata/web accordingly
    web files owner = root
    web files group = root

    # do not load/save the database
    memory mode = ram

    # disable writing anything to disk
    error log = syslog
    debug log = none
    access log = none

    # you can overwrite these paths
    config directory = /etc/netdata
    plugins directory = /usr/libexec/netdata/plugins.d
    web files directory = /usr/share/netdata/web
    cache directory = /var/cache/netdata
    lib directory = /var/lib/netdata
    log directory = /var/log/netdata
    home directory = /var/cache/netdata

    # on weak single core systems setting this to no may help
    multi threaded web server = yes

    # web compression
    # on weak systems, set level to 1
    enable web responses gzip compression = yes
    web compression strategy = default
    web compression level = 3

    # IP and port to bind to
    bind to = 0.0.0.0:19999

Thanks for the additional insight, folks - I'll close this issue. We'll track the rest of the integration issues in https://bugs.freenas.org/issues/20677 - thanks!

Was this page helpful?
0 / 5 - 0 ratings