Code

6bd0a37b83688856d9eff85d63bd4d4f0ea297f8
[pkg-rrdtool.git] / doc / rrdcached.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <title>rrdcached</title>
5 <link rev="made" href="mailto:root@localhost" />
6 </head>
8 <body style="background-color: white">
10 <p><a name="__index__"></a></p>
11 <!-- INDEX BEGIN -->
12 <!--
14 <ul>
16         <li><a href="#name">NAME</a></li>
17         <li><a href="#synopsis">SYNOPSIS</a></li>
18         <li><a href="#description">DESCRIPTION</a></li>
19         <li><a href="#options">OPTIONS</a></li>
20         <li><a href="#affected_rrdtool_commands">AFFECTED RRDTOOL COMMANDS</a></li>
21         <li><a href="#error_reporting">ERROR REPORTING</a></li>
22         <li><a href="#how_it_works">HOW IT WORKS</a></li>
23         <li><a href="#security_considerations">SECURITY CONSIDERATIONS</a></li>
24         <li><a href="#protocol">PROTOCOL</a></li>
25         <ul>
27                 <li><a href="#valid_commands">Valid Commands</a></li>
28                 <li><a href="#performance_values">Performance Values</a></li>
29         </ul>
31         <li><a href="#signals">SIGNALS</a></li>
32         <li><a href="#bugs">BUGS</a></li>
33         <li><a href="#see_also">SEE ALSO</a></li>
34         <li><a href="#author">AUTHOR</a></li>
35         <li><a href="#contributors">CONTRIBUTORS</a></li>
36 </ul>
37 -->
38 <!-- INDEX END -->
40 <p>
41 </p>
42 <hr />
43 <h1><a name="name">NAME</a></h1>
44 <p>rrdcached - Data caching daemon for rrdtool</p>
45 <p>
46 </p>
47 <hr />
48 <h1><a name="synopsis">SYNOPSIS</a></h1>
49 <p><strong>rrdcached</strong>
50 [<strong>-l/-L</strong>&nbsp;<em>address</em>]
51 [<strong>-w</strong>&nbsp;<em>timeout</em>]
52 [<strong>-z</strong>&nbsp;<em>delay</em>]
53 [<strong>-f</strong>&nbsp;<em>timeout</em>]
54 [<strong>-p</strong>&nbsp;<em>pid_file</em>]
55 [<strong>-t</strong>&nbsp;<em>write_threads</em>]
56 [<strong>-j</strong>&nbsp;<em>journal_dir</em>]
57 [-F]
58 [-g]
59 [<strong>-b</strong>&nbsp;<em>base_dir</em>&nbsp;[<strong>-B</strong>]]</p>
60 <p>
61 </p>
62 <hr />
63 <h1><a name="description">DESCRIPTION</a></h1>
64 <p><strong>rrdcached</strong> is a daemon that receives updates to existing RRD files,
65 accumulates them and, if enough have been received or a defined time has
66 passed, writes the updates to the RRD file. A <em>flush</em> command may be used to
67 force writing of values to disk, so that graphing facilities and similar can
68 work with up-to-date data.</p>
69 <p>The daemon was written with big setups in mind. Those setups usually run into
70 IO&nbsp;related problems sooner or later for reasons that are beyond the scope
71 of this document. Check the wiki at the RRDTool homepage for details. Also
72 check <a href="#security_considerations">SECURITY CONSIDERATIONS</a> below before using this daemon! A detailed
73 description of how the daemon operates can be found in the <a href="#how_it_works">HOW IT WORKS</a>
74 section below.</p>
75 <p>
76 </p>
77 <hr />
78 <h1><a name="options">OPTIONS</a></h1>
79 <dl>
80 <dt><strong><a name="item__2dl_address"><strong>-l</strong> <em>address</em></a></strong><br />
81 </dt>
82 <dd>
83 Tells the daemon to bind to <em>address</em> and accept incoming connections on that
84 socket. If <em>address</em> begins with <code>unix:</code>, everything following that prefix is
85 interpreted as the path to a UNIX domain socket. Otherwise the address or node
86 name are resolved using <em>getaddrinfo</em>.
87 </dd>
88 <dd>
89 <p>For network sockets, a port may be specified by using the form
90 <code>[address]:port</code>. If the address is an IPv4 address or a fully
91 qualified domain name (i.&nbsp;e. the address contains at least one dot
92 (<code>.</code>)), the square brackets can be omitted, resulting in the (simpler)
93 <code>address:port</code> pattern.. The default port is <strong>42217/udp</strong>.</p>
94 </dd>
95 <dd>
96 <p>The following formats are accepted. Please note that the address of the UNIX
97 domain socket <strong>must</strong> start with a slash in the second case!</p>
98 </dd>
99 <dd>
100 <pre>
101    unix:&lt;/path/to/unix.sock&gt;
102    /&lt;path/to/unix.sock&gt;
103    &lt;hostname-or-ip&gt;
104    [&lt;hostname-or-ip&gt;]:&lt;port&gt;
105    &lt;hostname-or-ipv4&gt;:&lt;port&gt;</pre>
106 </dd>
107 <dd>
108 <p>If the <strong>-l</strong> option is not specified the default address,
109 <code>unix:/tmp/rrdcached.sock</code>, will be used.</p>
110 </dd>
111 <p></p>
112 <dt><strong><a name="item__2dl_address"><strong>-L</strong> <em>address</em></a></strong><br />
113 </dt>
114 <dd>
115 Same as <strong>-l</strong>, except creates a low-privilege socket.  See <strong>SECURITY
116 CONSIDERATIONS</strong> for more information.
117 </dd>
118 <p></p>
119 <dt><strong><a name="item__2dw_timeout"><strong>-w</strong> <em>timeout</em></a></strong><br />
120 </dt>
121 <dd>
122 Data is written to disk every <em>timeout</em> seconds. If this option is not
123 specified the default interval of 300&nbsp;seconds will be used.
124 </dd>
125 <p></p>
126 <dt><strong><a name="item__2dz_delay"><strong>-z</strong> <em>delay</em></a></strong><br />
127 </dt>
128 <dd>
129 If specified, rrdcached will delay writing of each RRD for a random number
130 of seconds in the range&nbsp;[0,<em>delay</em>).  This will avoid too many
131 writes being queued simultaneously.  This value should be no greater than
132 the value specified in <strong>-w</strong>.  By default, there is no delay.
133 </dd>
134 <p></p>
135 <dt><strong><a name="item__2df_timeout"><strong>-f</strong> <em>timeout</em></a></strong><br />
136 </dt>
137 <dd>
138 Every <em>timeout</em> seconds the entire cache is searched for old values which are
139 written to disk. This only concerns files to which updates have stopped, so
140 setting this to a high value, such as 3600&nbsp;seconds, is acceptable in most
141 cases. This timeout defaults to 3600&nbsp;seconds.
142 </dd>
143 <p></p>
144 <dt><strong><a name="item__2dp_file"><strong>-p</strong> <em>file</em></a></strong><br />
145 </dt>
146 <dd>
147 Sets the name and location of the PID-file. If not specified, the default,
148 <code>$localststedir/run/rrdcached.pid</code> will be used.
149 </dd>
150 <p></p>
151 <dt><strong><a name="item__2dt_write_threads"><strong>-t</strong> <em>write_threads</em></a></strong><br />
152 </dt>
153 <dd>
154 Specifies the number of threads used for writing RRD files.  The default
155 is&nbsp;4.  Increasing this number will allow rrdcached to have more
156 simultaneous I/O requests into the kernel.  This may allow the kernel to
157 re-order disk writes, resulting in better disk throughput.
158 </dd>
159 <p></p>
160 <dt><strong><a name="item__2dj_dir"><strong>-j</strong> <em>dir</em></a></strong><br />
161 </dt>
162 <dd>
163 Write updates to a journal in <em>dir</em>.  In the event of a program or system
164 crash, this will allow the daemon to write any updates that were pending
165 at the time of the crash.
166 </dd>
167 <dd>
168 <p>On startup, the daemon will check for journal files in this directory.  If
169 found, all updates therein will be read into memory before the daemon
170 starts accepting new connections.</p>
171 </dd>
172 <dd>
173 <p>The journal will be rotated with the same frequency as the flush timer
174 given by <strong>-f</strong>.</p>
175 </dd>
176 <dd>
177 <p>When journaling is enabled, the daemon will use a fast shutdown procedure.
178 Rather than flushing all files to disk, it will make sure the journal is
179 properly written and exit immediately.  Although the RRD data files are
180 not fully up-to-date, no information is lost; all pending updates will be
181 replayed from the journal next time the daemon starts up.</p>
182 </dd>
183 <dd>
184 <p>To disable fast shutdown, use the <strong>-F</strong> option.</p>
185 </dd>
186 <p></p>
187 <dt><strong><a name="item__2df"><strong>-F</strong></a></strong><br />
188 </dt>
189 <dd>
190 ALWAYS flush all updates to the RRD data files when the daemon is shut
191 down, regardless of journal setting.
192 </dd>
193 <p></p>
194 <dt><strong><a name="item__2dg"><strong>-g</strong></a></strong><br />
195 </dt>
196 <dd>
197 Run in the foreground.  The daemon will not fork().
198 </dd>
199 <p></p>
200 <dt><strong><a name="item__2db_dir"><strong>-b</strong> <em>dir</em></a></strong><br />
201 </dt>
202 <dd>
203 The daemon will change into a specific directory at startup. All files passed
204 to the daemon, that are specified by a <strong>relative</strong> path, will be interpreted
205 to be relative to this directory. If not given the default, <code>/tmp</code>, will be
206 used.
207 </dd>
208 <dd>
209 <pre>
210   +------------------------+------------------------+
211   ! Command line           ! File updated           !
212   +------------------------+------------------------+
213   ! foo.rrd                ! /tmp/foo.rrd           !
214   ! foo/bar.rrd            ! /tmp/foo/bar.rrd       !
215   ! /var/lib/rrd/foo.rrd   ! /var/lib/rrd/foo.rrd   !
216   +------------------------+------------------------+
217   Paths given on the command  line and paths actually
218   updated by the daemon,  assuming the base directory
219   &quot;/tmp&quot;.</pre>
220 </dd>
221 <dd>
222 <p><strong>WARNING:</strong> The paths up to and including the base directory <strong>MUST NOT BE</strong>
223 symbolic links.  In other words, if the base directory is
224 specified as:</p>
225 </dd>
226 <dd>
227 <pre>
228     -b /base/dir/somewhere</pre>
229 </dd>
230 <dd>
231 <p>... then <strong>NONE</strong> of the following should be symbolic links:</p>
232 </dd>
233 <dd>
234 <pre>
235     /base
236     /base/dir
237     /base/dir/somewhere</pre>
238 </dd>
239 <p></p>
240 <dt><strong><a name="item__2db"><strong>-B</strong></a></strong><br />
241 </dt>
242 <dd>
243 Only permit writes into the base directory specified in <strong>-b</strong> (and any
244 sub-directories).  This does <strong>NOT</strong> detect symbolic links.  Paths
245 containing <code>../</code> will also be blocked.
246 </dd>
247 <p></p></dl>
248 <p>
249 </p>
250 <hr />
251 <h1><a name="affected_rrdtool_commands">AFFECTED RRDTOOL COMMANDS</a></h1>
252 <p>The following commands may be made aware of the <strong>rrdcached</strong> using the command
253 line argument <strong>--daemon</strong> or the environment variable <strong>RRDCACHED_ADDRESS</strong>:</p>
254 <dl>
255 <dt><strong><a name="item_dump"><strong>dump</strong></a></strong><br />
256 </dt>
257 <dt><strong><a name="item_fetch"><strong>fetch</strong></a></strong><br />
258 </dt>
259 <dt><strong><a name="item_flush"><strong>flush</strong></a></strong><br />
260 </dt>
261 <dt><strong><a name="item_graph"><strong>graph</strong></a></strong><br />
262 </dt>
263 <dt><strong><a name="item_graphv"><strong>graphv</strong></a></strong><br />
264 </dt>
265 <dt><strong><a name="item_info"><strong>info</strong></a></strong><br />
266 </dt>
267 <dt><strong><a name="item_last"><strong>last</strong></a></strong><br />
268 </dt>
269 <dt><strong><a name="item_lastupdate"><strong>lastupdate</strong></a></strong><br />
270 </dt>
271 <dt><strong><a name="item_update"><strong>update</strong></a></strong><br />
272 </dt>
273 <dt><strong><a name="item_xport"><strong>xport</strong></a></strong><br />
274 </dt>
275 </dl>
276 <p>The <strong>update</strong> command can send values to the daemon instead of writing them to
277 the disk itself. All other commands can send a <strong>FLUSH</strong> command (see below) to
278 the daemon before accessing the files, so they work with up-to-date data even
279 if the cache timeout is large.</p>
280 <p>
281 </p>
282 <hr />
283 <h1><a name="error_reporting">ERROR REPORTING</a></h1>
284 <p>The daemon reports errors in one of two ways: During startup, error messages
285 are printed to <code>STDERR</code>. One of the steps when starting up is to fork to the
286 background and closing <code>STDERR</code> - after this writing directly to the user is
287 no longer possible. Once this has happened, the daemon will send log messages
288 to the system logging daemon using <em>syslog(3)</em>. The facility used is
289 <code>LOG_DAEMON</code>.</p>
290 <p>
291 </p>
292 <hr />
293 <h1><a name="how_it_works">HOW IT WORKS</a></h1>
294 <p>When receiving an update, <strong>rrdcached</strong> does not write to disk but looks for an
295 entry for that file in its internal tree. If not found, an entry is created
296 including the current time (called ``First'' in the diagram below). This time is
297 <strong>not</strong> the time specified on the command line but the time the operating system
298 considers to be ``now''. The value and time of the value (called ``Time'' in the
299 diagram below) are appended to the tree node.</p>
300 <p>When appending a value to a tree node, it is checked whether it's time to write
301 the values to disk. Values are written to disk if
302 <code>now()&nbsp;-&nbsp;First&nbsp;&gt;=&nbsp;timeout</code>, where <code>timeout</code> is the timeout specified
303 using the <strong>-w</strong> option, see <em>OPTIONS</em>. If the values are ``old enough'' they
304 will be enqueued in the ``update queue'', i.&nbsp;e. they will be appended to
305 the linked list shown below.  Because the tree nodes and the elements of the
306 linked list are the same data structures in memory, any update to a file that
307 has already been enqueued will be written with the next write to the RRD file,
308 too.</p>
309 <p>A separate ``update thread'' constantly dequeues the first element in the update
310 queue and writes all its values to the appropriate file. So as long as the
311 update queue is not empty files are written at the highest possible rate.</p>
312 <p>Since the timeout of files is checked only when new values are added to the
313 file, ``dead'' files, i.&nbsp;e. files that are not updated anymore, would never
314 be written to disk. Therefore, every now and then, controlled by the <strong>-f</strong>
315 option, the entire tree is walked and all ``old'' values are enqueued. Since this
316 only affects ``dead'' files and walking the tree is relatively expensive, you
317 should set the ``flush interval'' to a reasonably high value. The default is
318 3600&nbsp;seconds (one hour).</p>
319 <p>The downside of caching values is that they won't show up in graphs generated
320 from the RRD&nbsp;files. To get around this, the daemon provides the ``flush
321 command'' to flush specific files. This means that the file is inserted at the
322 <strong>head</strong> of the update queue or moved there if it is already enqueued. The flush
323 command will return only after the file's pending updates have been written
324 to disk.</p>
325 <pre>
326  +------+   +------+                               +------+
327  ! head !   ! root !                               ! tail !
328  +---+--+   +---+--+                               +---+--+
329      !         /\                                      !
330      !        /  \                                     !
331      !       /\  /\                                    !
332      !      /\/\ \ `----------------- ... --------,    !
333      V     /      `-------,                       !    V
334  +---+----+---+    +------+-----+             +---+----+---+
335  ! File:  foo !    ! File:  bar !             ! File:  qux !
336  ! First: 101 !    ! First: 119 !             ! First: 180 !
337  ! Next:&amp;bar -+---&gt;! Next:&amp;... -+---&gt; ... ---&gt;! Next:NULL  !
338  | Prev:NULL  !&lt;---+-Prev:&amp;foo  !&lt;--- ... ----+-Prev: &amp;... !
339  +============+    +============+             +============+
340  ! Time:  100 !    ! Time:  120 !             ! Time:  180 !
341  ! Value:  10 !    ! Value: 0.1 !             ! Value: 2,2 !
342  +------------+    +------------+             +------------+
343  ! Time:  110 !    ! Time:  130 !             ! Time:  190 !
344  ! Value:  26 !    ! Value: 0.1 !             ! Value: 7,3 !
345  +------------+    +------------+             +------------+
346  :            :    :            :             :            :
347  +------------+    +------------+             +------------+
348  ! Time:  230 !    ! Time:  250 !             ! Time:  310 !
349  ! Value:  42 !    ! Value: 0.2 !             ! Value: 1,2 !
350  +------------+    +------------+             +------------+</pre>
351 <p>The above diagram demonstrates:</p>
352 <ul>
353 <li></li>
354 Files/values are stored in a (balanced) tree.
355 <p></p>
356 <li></li>
357 Tree nodes and entries in the update queue are the same data structure.
358 <p></p>
359 <li></li>
360 The local time (``First'') and the time specified in updates (``Time'') may differ.
361 <p></p>
362 <li></li>
363 Timed out values are inserted at the ``tail''.
364 <p></p>
365 <li></li>
366 Explicitly flushed values are inserted at the ``head''.
367 <p></p>
368 <li></li>
369 ASCII art rocks.
370 <p></p></ul>
371 <p>
372 </p>
373 <hr />
374 <h1><a name="security_considerations">SECURITY CONSIDERATIONS</a></h1>
375 <p>The client/server protocol does not have any authentication or
376 authorization mechanism.  Therefore, take care to restrict which users can
377 connect to the daemon.</p>
378 <p>Control sockets are divided into high-privilege (<strong>-l</strong>) and low-privilege
379 (<strong>-L</strong>) sockets.  High-privilege sockets accept all commands, whereas
380 low-privilege sockets accept only <strong>FLUSH</strong>, <strong>STATS</strong>, and <strong>HELP</strong>.</p>
381 <p>For a multi-user environment where only certain users require read/write
382 access, the recommended configuration uses two sockets as follows:</p>
383 <dl>
384 <dt><strong><a name="item__2dl__2fprotected_2fdir_2frrd_2esock"><strong>-l</strong> <em>/protected/dir/rrd.sock</em></a></strong><br />
385 </dt>
386 <dd>
387 Create a high-privilege unix-domain socket.  This should be protected with
388 the same Unix permissions that are used to protect the RRD files.  Updates
389 should be directed to this socket.
390 </dd>
391 <p></p>
392 <dt><strong><a name="item__2dl_127_2e0_2e0_2e1"><strong>-L</strong> <em>127.0.0.1</em></a></strong><br />
393 </dt>
394 <dd>
395 Create a low-privilege TCP socket listening on localhost.  All users on
396 the local system may use this to trigger FLUSH of individual files.  Users
397 with read-only access should be directed to this socket.
398 </dd>
399 <p></p></dl>
400 <p>If you (want to) use the network capability, i.&nbsp;e. let the daemon bind to
401 an IPv4 or IPv6 socket, it is <strong>your</strong> job to install a packet filter or similar
402 mechanism to prevent unauthorized connections. Unless you have a dedicated VLAN
403 or VPN for this, using the network option is probably a bad idea!</p>
404 <p>The daemon will blindly write to any file it gets told, so you really should
405 create a separate user just for this daemon. Also it does not do any sanity
406 checks, so if it gets told to write values for a time far in the future, your
407 files will be messed up good!</p>
408 <p>You have been warned.</p>
409 <p>
410 </p>
411 <hr />
412 <h1><a name="protocol">PROTOCOL</a></h1>
413 <p>The daemon communicates with clients using a line based ASCII protocol which is
414 easy to read and easy to type. This makes it easy for scripts to implement the
415 protocol and possible for users to use <em>telnet</em> to connect to the daemon
416 and test stuff ``by hand''.</p>
417 <p>The protocol is line based, this means that each record consists of one or more
418 lines. A line is terminated by the line feed character <code>0x0A</code>, commonly
419 written as <code>\n</code>. In the examples below, this character will be written as
420 <code>&lt;LF&gt;</code> (``line feed'').</p>
421 <p>After the connection has been established, the client is expected to send a
422 ``command''. A command consists of the command keyword, possibly some arguments,
423 and a terminating newline character. For a list of commands, see
424 <a href="#valid_commands">Valid Commands</a> below.</p>
425 <p>Example:</p>
426 <pre>
427   FLUSH /tmp/foo.rrd&lt;LF&gt;</pre>
428 <p>The daemon answers with a line consisting of a status code and a short status
429 message, separated by one or more space characters. A negative status code
430 signals an error, a positive status code or zero signal success. If the status
431 code is greater than zero, it indicates the number of lines that follow the
432 status line.</p>
433 <p>Examples:</p>
434 <pre>
435  0 Success&lt;LF&gt;</pre>
436 <pre>
437  2 Two lines follow&lt;LF&gt;
438  This is the first line&lt;LF&gt;
439  And this is the second line&lt;LF&gt;</pre>
440 <p>
441 </p>
442 <h2><a name="valid_commands">Valid Commands</a></h2>
443 <p>The following commands are understood by the daemon:</p>
444 <dl>
445 <dt><strong><a name="item_flush_filename"><strong>FLUSH</strong> <em>filename</em></a></strong><br />
446 </dt>
447 <dd>
448 Causes the daemon to put <em>filename</em> to the <strong>head</strong> of the update queue
449 (possibly moving it there if the node is already enqueued). The answer will be
450 sent <strong>after</strong> the node has been dequeued.
451 </dd>
452 <p></p>
453 <dt><strong><a name="item_flushall"><strong>FLUSHALL</strong></a></strong><br />
454 </dt>
455 <dd>
456 Causes the daemon to start flushing ALL pending values to disk.  This
457 returns immediately, even though the writes may take a long time.
458 </dd>
459 <p></p>
460 <dt><strong><a name="item_pending_filename"><strong>PENDING</strong> <em>filename</em></a></strong><br />
461 </dt>
462 <dd>
463 Shows any ``pending'' updates for a file, in order.  The updates shown have
464 not yet been written to the underlying RRD file.
465 </dd>
466 <p></p>
467 <dt><strong><a name="item_forget_filename"><strong>FORGET</strong> <em>filename</em></a></strong><br />
468 </dt>
469 <dd>
470 Removes <em>filename</em> from the cache.  Any pending updates <strong>WILL BE LOST</strong>.
471 </dd>
472 <p></p>
473 <dt><strong><a name="item_queue"><strong>QUEUE</strong></a></strong><br />
474 </dt>
475 <dd>
476 Shows the files that are on the output queue.  Returns zero or more lines
477 in the following format, where &lt;num_vals&gt; is the number of values
478 to be written for the &lt;file&gt;:
479 </dd>
480 <dd>
481 <pre>
482     &lt;num_vals&gt; &lt;file&gt;</pre>
483 </dd>
484 <p></p>
485 <dt><strong><a name="item_help__5bcommand_5d"><strong>HELP</strong> [<em>command</em>]</a></strong><br />
486 </dt>
487 <dd>
488 Returns a short usage message. If no command is given, or <em>command</em> is
489 <strong>HELP</strong>, a list of commands supported by the daemon is returned. Otherwise a
490 short description, possibly containing a pointer to a manual page, is returned.
491 Obviously, this is meant for interactive usage and the format in which the
492 commands and usage summaries are returned is not well defined.
493 </dd>
494 <p></p>
495 <dt><strong><a name="item_stats"><strong>STATS</strong></a></strong><br />
496 </dt>
497 <dd>
498 Returns a list of metrics which can be used to measure the daemons performance
499 and check its status. For a description of the values returned, see
500 <a href="#performance_values">Performance Values</a> below.
501 </dd>
502 <dd>
503 <p>The format in which the values are returned is similar to many other line based
504 protocols: Each value is printed on a separate line, each consisting of the
505 name of the value, a colon, one or more spaces and the actual value.</p>
506 </dd>
507 <dd>
508 <p>Example:</p>
509 </dd>
510 <dd>
511 <pre>
512  9 Statistics follow
513  QueueLength: 0
514  UpdatesReceived: 30
515  FlushesReceived: 2
516  UpdatesWritten: 13
517  DataSetsWritten: 390
518  TreeNodesNumber: 13
519  TreeDepth: 4
520  JournalBytes: 190
521  JournalRotate: 0</pre>
522 </dd>
523 <p></p>
524 <dt><strong><a name="item_update_filename_values__5bvalues__2e_2e_2e_5d"><strong>UPDATE</strong> <em>filename</em> <em>values</em> [<em>values</em> ...]</a></strong><br />
525 </dt>
526 <dd>
527 Adds more data to a filename. This is <strong>the</strong> operation the daemon was designed
528 for, so describing the mechanism again is unnecessary. Read <a href="#how_it_works">HOW IT WORKS</a>
529 above for a detailed explanation.
530 </dd>
531 <dd>
532 <p>Note that rrdcached only accepts absolute timestamps in the update values.
533 Updates strings like ``N:1:2:3'' are automatically converted to absolute
534 time by the RRD client library before sending to rrdcached.</p>
535 </dd>
536 <p></p>
537 <dt><strong><a name="item_wrote_filename"><strong>WROTE</strong> <em>filename</em></a></strong><br />
538 </dt>
539 <dd>
540 This command is written to the journal after a file is successfully
541 written out to disk.  It is used during journal replay to determine which
542 updates have already been applied.  It is <em>only</em> valid in the journal; it
543 is not accepted from the other command channels.
544 </dd>
545 <p></p>
546 <dt><strong><a name="item_batch"><strong>BATCH</strong></a></strong><br />
547 </dt>
548 <dd>
549 This command initiates the bulk load of multiple commands.  This is
550 designed for installations with extremely high update rates, since it
551 permits more than one command to be issued per <code>read()</code> and write().
552 </dd>
553 <dd>
554 <p>All commands are executed just as they would be if given individually,
555 except for output to the user.  Messages indicating success are
556 suppressed, and error messages are delayed until the client is finished.</p>
557 </dd>
558 <dd>
559 <p>Command processing is finished when the client sends a dot (``.'') on its
560 own line.  After the client has finished, the server responds with an
561 error count and the list of error messages (if any).  Each error messages
562 indicates the number of the command to which it corresponds, and the error
563 message itself.  The first user command after <strong>BATCH</strong> is command number one.</p>
564 </dd>
565 <dd>
566 <pre>
567     client:  BATCH
568     server:  0 Go ahead.  End with dot '.' on its own line.
569     client:  UPDATE x.rrd 1223661439:1:2:3            &lt;--- command #1
570     client:  UPDATE y.rrd 1223661440:3:4:5            &lt;--- command #2
571     client:  and so on...
572     client:  .
573     server:  2 Errors
574     server:  1 message for command 1
575     server:  12 message for command 12</pre>
576 </dd>
577 <p></p>
578 <dt><strong><a name="item_quit"><strong>QUIT</strong></a></strong><br />
579 </dt>
580 <dd>
581 Disconnect from rrdcached.
582 </dd>
583 <p></p></dl>
584 <p>
585 </p>
586 <h2><a name="performance_values">Performance Values</a></h2>
587 <p>The following counters are returned by the <strong>STATS</strong> command:</p>
588 <dl>
589 <dt><strong><a name="item_queuelength"><strong>QueueLength</strong> <em>(unsigned 64bit integer)</em></a></strong><br />
590 </dt>
591 <dd>
592 Number of nodes currently enqueued in the update queue.
593 </dd>
594 <p></p>
595 <dt><strong><a name="item_updatesreceived"><strong>UpdatesReceived</strong> <em>(unsigned 64bit integer)</em></a></strong><br />
596 </dt>
597 <dd>
598 Number of UPDATE commands received.
599 </dd>
600 <p></p>
601 <dt><strong><a name="item_flushesreceived"><strong>FlushesReceived</strong> <em>(unsigned 64bit integer)</em></a></strong><br />
602 </dt>
603 <dd>
604 Number of FLUSH commands received.
605 </dd>
606 <p></p>
607 <dt><strong><a name="item_updateswritten"><strong>UpdatesWritten</strong> <em>(unsigned 64bit integer)</em></a></strong><br />
608 </dt>
609 <dd>
610 Total number of updates, i.&nbsp;e. calls to <code>rrd_update_r</code>, since the
611 daemon was started.
612 </dd>
613 <p></p>
614 <dt><strong><a name="item_datasetswritten"><strong>DataSetsWritten</strong> <em>(unsigned 64bit integer)</em></a></strong><br />
615 </dt>
616 <dd>
617 Total number of ``data sets'' written to disk since the daemon was
618 started. A data set is one or more values passed to the <strong>UPDATE</strong>
619 command. For example: <code>1223661439:123:456</code> is one data set with two
620 values. The term ``data set'' is used to prevent confusion whether
621 individual values or groups of values are counted.
622 </dd>
623 <p></p>
624 <dt><strong><a name="item_treenodesnumber"><strong>TreeNodesNumber</strong> <em>(unsigned 64bit integer)</em></a></strong><br />
625 </dt>
626 <dd>
627 Number of nodes in the cache.
628 </dd>
629 <p></p>
630 <dt><strong><a name="item_treedepth"><strong>TreeDepth</strong> <em>(unsigned 64bit integer)</em></a></strong><br />
631 </dt>
632 <dd>
633 Depth of the tree used for fast key lookup.
634 </dd>
635 <p></p>
636 <dt><strong><a name="item_journalbytes"><strong>JournalBytes</strong> <em>(unsigned 64bit integer)</em></a></strong><br />
637 </dt>
638 <dd>
639 Total number of bytes written to the journal since startup.
640 </dd>
641 <p></p>
642 <dt><strong><a name="item_journalrotate"><strong>JournalRotate</strong> <em>(unsigned 64bit integer)</em></a></strong><br />
643 </dt>
644 <dd>
645 Number of times the journal has been rotated since startup.
646 </dd>
647 <p></p></dl>
648 <p>
649 </p>
650 <hr />
651 <h1><a name="signals">SIGNALS</a></h1>
652 <dl>
653 <dt><strong><a name="item_sigint_and_sigterm">SIGINT and SIGTERM</a></strong><br />
654 </dt>
655 <dd>
656 The daemon exits normally on receipt of either of these signals.  Pending
657 updates are handled in accordance with the <strong>-j</strong> and <strong>-F</strong> options.
658 </dd>
659 <p></p>
660 <dt><strong><a name="item_sigusr1">SIGUSR1</a></strong><br />
661 </dt>
662 <dd>
663 The daemon exits AFTER flushing all updates out to disk.  This may take a
664 while.
665 </dd>
666 <p></p>
667 <dt><strong><a name="item_sigusr2">SIGUSR2</a></strong><br />
668 </dt>
669 <dd>
670 The daemon exits immediately, without flushing updates out to disk.
671 Pending updates will be replayed from the journal when the daemon starts
672 up again.  <strong>WARNING: if journaling (-j) is NOT enabled, any pending
673 updates WILL BE LOST</strong>.
674 </dd>
675 <p></p></dl>
676 <p>
677 </p>
678 <hr />
679 <h1><a name="bugs">BUGS</a></h1>
680 <p>No known bugs at the moment.</p>
681 <p>
682 </p>
683 <hr />
684 <h1><a name="see_also">SEE ALSO</a></h1>
685 <p><a href="././rrdtool.html">the rrdtool manpage</a>, <a href="././rrdgraph.html">the rrdgraph manpage</a></p>
686 <p>
687 </p>
688 <hr />
689 <h1><a name="author">AUTHOR</a></h1>
690 <p><strong>rrdcached</strong> and this manual page have been written by Florian Forster
691 &lt;octo&nbsp;at&nbsp;verplant.org&gt;.</p>
692 <p>
693 </p>
694 <hr />
695 <h1><a name="contributors">CONTRIBUTORS</a></h1>
696 <p>kevin brintnall &lt;<a href="mailto:kbrint@rufus.net">kbrint@rufus.net</a>&gt;</p>
698 </body>
700 </html>