Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
Performance optimisations RDDcache
#1
This document will give you some guidance on optimising your setup.
The suggestions are in a rough order of how much impact they will have.

[titreyoyo]RRDCached[/titreyoyo]
We absolutely recommend running this, it will save on IO load. RRDCached

[titreyoyo]Setting up RRDCached[/titreyoyo]

This document will explain how to set up RRDCached for LibreNMS.

Since version 1.5, rrdtool / rrdcached now supports creating rrd files over rrdcached. If you have rrdcached 1.5.5 or above, you can also tune over rrdcached. To enable this set the following config:

Code :
$config['rrdtool_version'] = '1.5.5';
This setting has to be the exact version of rrdtool you are running.
NOTE: This feature requires your client version of rrdtool to be 1.5.5 or newer, in addition to your rrdcached version.

[titreyoyo]Distributed Poller Support Matrix[/titreyoyo]

Shared FS: Is a shared filesystem required?

Features: Supported features in the version indicated.
Code :
G = Graphs.
C = Create RRD files.
U = Update RRD files.
T = Tune RRD files.
   
[titreyoyo]RRDCached installation Debian Buster[/titreyoyo]

(rrdcached 1.7.1)

1: Install rrdcached

Code :
sudo apt-get install rrdcached
2: Editer le fichier 

Code :
nano  /etc/default/rrdcached
to include:

Code :
DAEMON=/usr/bin/rrdcached
WRITE_TIMEOUT=1800
WRITE_JITTER=1800
WRITE_THREADS=4
BASE_PATH=/opt/librenms/rrd/
JOURNAL_PATH=/var/lib/rrdcached/journal/
PIDFILE=/var/run/rrdcached.pid
SOCKFILE=/run/rrdcached.sock
SOCKGROUP=librenms
DAEMON_GROUP=librenms
DAEMON_USER=librenms
BASE_OPTIONS="-B -F -R"
3: Fix permissions

Code :
chown librenms:librenms /var/lib/rrdcached/journal/
4: Restart the rrdcached service

Code :
systemctl restart rrdcached.service
5: Edit /opt/librenms/config.php to include:

Code :
nano /opt/librenms/config.php

For local RRDCached server

Code :
$config['rrdcached'] = "unix:/run/rrdcached.sock";
For remote RRDCached server make sure you have network option in /var/default/rrdcached

Code :
NETWORK_OPTIONS="-L"
Code :
$config['rrdcached'] = "IPADDRESS:42217";
NOTE: change IPADDRESS to the ip the rrdcached server is listening on.
[titreyoyo]Verify[/titreyoyo]
Check to see if the graphs are being drawn in LibreNMS. This might take a few minutes. After at least one poll cycle (5 mins), check the LibreNMS disk I/O performance delta. Disk I/O can be found under the menu Devices>All Devices>localhost hostname>Health>Disk I/O.

Depending on many factors, you should see the Ops/sec drop by ~30-40%.

[titreyoyo]Securing RRCached[/titreyoyo]

According to the man page, under "SECURITY CONSIDERATIONS", rrdcached has no authentication or security except for running under a unix socket. If you choose to use a network socket instead of a unix socket, you will need to secure your rrdcached installation. To do so you can proxy rrdcached using nginx to allow only specific IPs to connect.

Using the same setup above, using nginx version 1.9.0 or later, you can follow this setup to proxy the default rrdcached port to the local unix socket.

(You can use ./conf.d for your configuration as well)

Code :
mkdir /etc/nginx/streams-{available,enabled}
add the following to your nginx.conf file:

Code :
#/etc/nginx/nginx.conf
...
stream {
    include /etc/nginx/streams-enabled/*;
}
Add this to /etc/nginx/streams-available/rrd

Code :
server {
    listen 42217;

    error_log  /var/log/nginx/rrd.stream.error.log;

    allow $LibreNMS_IP;
    deny all;

    proxy_pass unix:/run/rrdcached.sock;
}
Replace $LibreNMS_IP with the ip of the server that will be using rrdcached. You can specify more than one allow statement. This will bind nginx to TCP 42217 (the default rrdcached port), allow the specified IPs to connect, and deny all others.

next, we'll symlink the config to streams-enabled:

Code :
ln -s /etc/nginx/streams-{available,enabled}/rrd
and reload nginx 
Code :
service nginx reload
Répondre


Messages dans ce sujet
Performance optimisations RDDcache - par yoyo - 02-11-2022, 22:40

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)