Speeding up graphs with RRDCacheD
When the graphs are stored with the RRDTool engine, every IP graph update is a small random disk write. RRDCacheD batches these updates in memory and flushes them in bulk, which greatly reduces the disk I/O of the Console server.
RRDTool — even with RRDCacheD — is not fast enough to sustain updating thousands of very-high-granularity IP graphs. If that is your situation, consider switching the Graph Storage Engine to InfluxDB or ClickHouse in Configuration » General Settings » Graphs & Storage instead.
Ubuntu / Debian
- Install the packages:
apt-get install rrdtool rrdcached
- Edit /etc/default/rrdcached and set:
OPTS="-l unix:/var/run/rrdcached.sock -s andrisoft -m 774 -w 3600 -f 7200 -F -b /var/lib/rrdcached/db/"
- The ownership and permissions of the socket reset on every service start, so let systemd fix them automatically: run
systemctl edit rrdcachedand add:[Service] ExecStartPost=/bin/sh -c "/bin/sleep 2; /bin/chown andrisoft:www-data /var/run/rrdcached.sock; /bin/chmod 770 /var/run/rrdcached.sock"
- Enable and start the service:
systemctl daemon-reload systemctl enable --now rrdcached
- Add unix:/var/run/rrdcached.sock to the RRDCached Socket field in Configuration » General Settings » Graphs & Storage. The existing IP graphs do not need to be deleted.
Rocky Linux / AlmaLinux / RHEL
- Install RRDTool (the rrdcached daemon is included in the rrdtool package):
dnf install rrdtool
- Create the service file /usr/lib/systemd/system/rrdcached.service with the following content:
[Unit] Description=RRDCacheD for Andrisoft [Service] Restart=always User=andrisoft PermissionsStartOnly=yes ExecStartPre=/bin/sh -c "/bin/mkdir -p /var/rrdtool/rrdcached/; /bin/chown andrisoft:andrisoft /var/rrdtool/rrdcached" ExecStart=/usr/bin/rrdcached -l unix:/var/rrdtool/rrdcached/rrdcached.sock -s andrisoft -m 774 -w 3600 -g -p /var/rrdtool/rrdcached/rrdcached.pid ExecStartPost=/bin/sh -c "/bin/sleep 4; /bin/chown andrisoft:apache /var/rrdtool/rrdcached/rrdcached.sock; /bin/chown andrisoft:andrisoft /var/rrdtool/rrdcached/rrdcached.pid; /bin/chmod 770 /var/rrdtool/rrdcached/rrdcached.sock" [Install] WantedBy=multi-user.target
- Enable and start the service:
systemctl daemon-reload systemctl enable --now rrdcached
- Add unix:/var/rrdtool/rrdcached/rrdcached.sock to the RRDCached Socket field in Configuration » General Settings » Graphs & Storage. The existing IP graphs do not need to be deleted.
Checking that it works
You can watch RRDCacheD at work with (replace the socket path on Rocky/Alma/RHEL):
while true; do clear; echo STATS | socat - /var/run/rrdcached.sock; sleep 1; done
AuthorAndrisoft Team
Date Created26 December 2012
Date Updated16 August 2026
Views30,489

