1 (edited by wayne.workman Today 02:07:29)

Topic: Netdata v2: disable the netflow and otel plugins to save RAM

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.8.8
- Deployed with iRedMail Easy or the downloadable installer? Downloadable installer
- Linux/BSD distribution name and version: Debian 12 (bookworm)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL (MariaDB)
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No, open source iRedAdmin
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue. Not an issue report; this is a tip for other users.
====


BACKGROUND
----------

Recent iRedMail releases recommend upgrading Netdata to v2.x. I upgraded
from Netdata v1.44.1 to v2.12.0 on a small iRedMail server (2 GB RAM, no
SOGo, ClamAV disabled to save memory). After the upgrade, Netdata used a
lot more memory: about 380 MB across all of its processes. Its main
process alone had used about 116 MB under v1.

Most of the increase came from two plugins that Netdata v2 starts by
default:

  netflow-plugin  (about 143 MB)
      Collects NetFlow / IPFIX / sFlow flow records exported by routers
      and switches.

  otel-plugin     (about 34 MB)
      Receives OpenTelemetry (OTLP) metrics and logs pushed by other
      applications.

A typical iRedMail server neither receives flow exports from network gear
nor has applications pushing OpenTelemetry data to Netdata. On a server
like that, both plugins sit idle while holding memory.

With both disabled, Netdata's total memory use dropped from about 380 MB
to about 211 MB. All the normal charts (system, Nginx, MySQL/MariaDB,
PHP-FPM, and so on) kept working.

Your numbers will differ. Check your own server with this command
(RSS is in KB):

    ps -eo rss,comm --sort=-rss | grep -E 'netflow|otel|netdata|plugin'


WHO SHOULD NOT DO THIS
----------------------

Leave these plugins enabled if any of the following applies:

  * You point routers, switches or firewalls at this server to export
    NetFlow / IPFIX / sFlow data and view it in Netdata. That is exactly
    what netflow-plugin does.

  * You have applications or collectors sending OpenTelemetry (OTLP)
    metrics or logs to this Netdata agent. That is what otel-plugin does.

  * You are not sure whether anything uses them and have plenty of RAM.
    In that case the saving may not be worth the risk.

If you only use Netdata's built-in dashboard to watch the mail server
itself, you most likely use neither.


HOW TO DISABLE THEM
-------------------

These steps were done on Debian 12 with Netdata installed the way
iRedMail installs it: the static build under /opt/netdata. They may
help on other distributions, but the location of netdata.conf can
differ. With a native distro package, for example, it is usually
/etc/netdata/netdata.conf. Adjust paths for your system.

Step 1. Check that the two plugin switches exist in your version. The
        running configuration lists every option, with defaults
        commented out:

    curl -s http://127.0.0.1:19999/netdata.conf | sed -n '/^\[plugins\]/,/^\[/p' | grep -E 'netflow|otel'

        You should see "# netflow = yes" and "# otel = yes". Adjust the
        port if your Netdata does not listen on 19999.

Step 2. Back up the config file:

    cp -a /opt/netdata/etc/netdata/netdata.conf /opt/netdata/etc/netdata/netdata.conf.bak

Step 3. Edit /opt/netdata/etc/netdata/netdata.conf. You can also use
        Netdata's helper:

    /opt/netdata/etc/netdata/edit-config netdata.conf

        If the file already has a [plugins] section, add the two lines
        below to it. Otherwise, add this whole block at the end of the
        file:

    [plugins]
        netflow = no
        otel = no

Step 4. Restart Netdata:

    systemctl restart netdata

Step 5. Verify. After about 30 seconds, run:

    systemctl is-active netdata
    ps -eo rss,comm --sort=-rss | grep -E 'netflow|otel'
    curl -s http://127.0.0.1:19999/netdata.conf | grep -E '^\s*(netflow|otel) ='

        - The first command should print "active".
        - The second command should print nothing.
        - The third command should show "netflow = no" and "otel = no"
          without a leading "#".

        Then open your Netdata dashboard and confirm your usual charts are
        still there.


NOTES
-----

  * The setting survives Netdata upgrades. Running a newer static
    installer (netdata-x86_64-vX.Y.Z.gz.run) left my existing
    netdata.conf untouched.

  * To undo, remove the two lines (or set them to "yes") and restart
    Netdata.

  * The same [plugins] section can switch off other plugins you do not
    need, such as "ebpf" or "network-viewer". Check what each one does
    before disabling it.

  * Measure on your own server before and after. The figures above come
    from one small server and are only an indication.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.