munin icon indicating copy to clipboard operation
munin copied to clipboard

rrdcached does not receive any FLUSH request when graphing.

Open ssm opened this issue 9 years ago • 2 comments

The rrdcached is not told to flush spooled data for a host when a graph is requested.

Stats from rrdcached after "munin-update".

% echo STATS | socat - sandbox/var/run/rrdcached.sock
9 Statistics follow
QueueLength: 0
UpdatesReceived: 5229
FlushesReceived: 0
UpdatesWritten: 0
DataSetsWritten: 0
TreeNodesNumber: 5229 
TreeDepth: 15 
JournalBytes: 601941
JournalRotate: 0

bug-before-xvda-day

After a request of the graph through munin-httpd, rrdcached should have received a FLUSH for that graph before generating the image, but the stats do not change.

After a manual FLUSH of the RRD file, the image has new content (The dotted line in the graph, showing the age of the last rrd update, has moved)

echo FLUSH example.com/mail.example.com-diskstats_utilization-xvda_util-g.rrd \
    | socat  - sandbox/var/run/rrdcached.sock

bug-after-xvda-day

…and so has the stats

% echo STATS | socat - sandbox/var/run/rrdcached.sock
9 Statistics follow
QueueLength: 0
UpdatesReceived: 5229
FlushesReceived: 1
UpdatesWritten: 1
DataSetsWritten: 1
TreeNodesNumber: 5229
TreeDepth: 15
JournalBytes: 602048
JournalRotate: 0

ssm avatar Apr 07 '15 12:04 ssm

With the environment variable set, it works

RRDCACHED_ADDRESS=unix:/srv/munin/sandbox/var/run/rrdcached.sock \
    ./dev_scripts/run munin-httpd

When I request a web page with graphs from munin-httpd, the FLUSH stats increase:

stats:

9 Statistics follow
QueueLength: 0
UpdatesReceived: 5229
FlushesReceived: 338
UpdatesWritten: 169
DataSetsWritten: 169
TreeNodesNumber: 5229
TreeDepth: 15
JournalBytes: 617124
JournalRotate: 0

What is needed is for munin-httpd to detect the

rrdcached_socket /srv/munin/sandbox/var/run/rrdcached.sock

…setting in munin.conf, and append a corresponding

--daemon unix:/srv/munin/sandbox/var/run/rrdcached.sock

argument to the rrd graph command invocation.

ssm avatar Apr 07 '15 12:04 ssm

That rrdcached_socket should appear in the param table of the SQLite db.

steveschnepp avatar Apr 08 '15 13:04 steveschnepp