ctdb-protocol: Add req_tunnel counts to ctdb statistics
[samba.git] / ctdb / doc / ctdb-statistics.7.xml
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry
3         PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
4         "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
5
6 <refentry id="ctdb-statistics.7">
7
8   <refmeta>
9     <refentrytitle>ctdb-statistics</refentrytitle>
10     <manvolnum>7</manvolnum>
11     <refmiscinfo class="source">ctdb</refmiscinfo>
12     <refmiscinfo class="manual">CTDB - clustered TDB database</refmiscinfo>
13   </refmeta>
14
15   <refnamediv>
16     <refname>ctdb-statistics</refname>
17     <refpurpose>CTDB statistics output</refpurpose>
18   </refnamediv>
19
20   <refsect1>
21     <title>OVERALL STATISTICS</title>
22
23     <para>
24       CTDB maintains information about various messages communicated
25       and some of the important operations per node.  See the
26       <citerefentry><refentrytitle>ctdb</refentrytitle>
27       <manvolnum>1</manvolnum></citerefentry> commands
28       <command>statistics</command> and <command>statisticsreset</command>
29       for displaying statistics.
30     </para>
31
32       <refsect2>
33         <title>Example: ctdb statistics</title>
34         <screen>
35 CTDB version 1
36 Current time of statistics  :                Fri Sep 12 13:32:32 2014
37 Statistics collected since  : (000 01:49:20) Fri Sep 12 11:43:12 2014
38  num_clients                        6
39  frozen                             0
40  recovering                         0
41  num_recoveries                     2
42  client_packets_sent           281293
43  client_packets_recv           296317
44  node_packets_sent             452387
45  node_packets_recv             182394
46  keepalive_packets_sent          3927
47  keepalive_packets_recv          3928
48  node
49      req_call                   48605
50      reply_call                     1
51      req_dmaster                23404
52      reply_dmaster              24917
53      reply_error                    0
54      req_message                  958
55      req_control               197513
56      reply_control             153705
57  client
58      req_call                  130866
59      req_message                  770
60      req_control               168921
61  timeouts
62      call                           0
63      control                        0
64      traverse                       0
65  locks
66      num_calls                    220
67      num_current                    0
68      num_pending                    0
69      num_failed                     0
70  total_calls                   130866
71  pending_calls                      0
72  childwrite_calls                   1
73  pending_childwrite_calls             0
74  memory_used                   334490
75  max_hop_count                     18
76  total_ro_delegations               2
77  total_ro_revokes                   2
78  hop_count_buckets: 42816 5464 26 1 0 0 0 0 0 0 0 0 0 0 0 0
79  lock_buckets: 9 165 14 15 7 2 2 0 0 0 0 0 0 0 0 0
80  locks_latency      MIN/AVG/MAX     0.000685/0.160302/6.369342 sec out of 214
81  reclock_ctdbd      MIN/AVG/MAX     0.004940/0.004969/0.004998 sec out of 2
82  reclock_recd       MIN/AVG/MAX     0.000000/0.000000/0.000000 sec out of 0
83  call_latency       MIN/AVG/MAX     0.000006/0.000719/4.562991 sec out of 126626
84  childwrite_latency MIN/AVG/MAX     0.014527/0.014527/0.014527 sec out of 1
85         </screen>
86       </refsect2>
87
88     <refsect2>
89       <title>CTDB version</title>
90       <para>
91         Version of the ctdb protocol used by the node.
92       </para>
93     </refsect2>
94
95     <refsect2>
96       <title>Current time of statistics</title>
97       <para>
98         Time when the statistics are generated.
99       </para>
100       <para>
101         This is useful when collecting statistics output periodically
102         for post-processing.
103       </para>
104     </refsect2>
105
106     <refsect2>
107       <title>Statistics collected since</title>
108       <para>
109         Time when ctdb was started or the last time statistics was reset.
110         The output shows the duration and the timestamp.
111       </para>
112     </refsect2>
113
114     <refsect2>
115       <title>num_clients</title>
116       <para>
117         Number of processes currently connected to CTDB's unix socket.
118         This includes recovery daemon, ctdb tool and samba processes
119         (smbd, winbindd).
120       </para>
121     </refsect2>
122
123     <refsect2>
124       <title>frozen</title>
125       <para>
126         1 if the the databases are currently frozen, 0 otherwise.
127       </para>
128     </refsect2>
129
130     <refsect2>
131       <title>recovering</title>
132       <para>
133         1 if recovery is active, 0 otherwise.
134       </para>
135     </refsect2>
136
137     <refsect2>
138       <title>num_recoveries</title>
139       <para>
140         Number of recoveries since the start of ctdb or since the last
141         statistics reset.
142       </para>
143     </refsect2>
144
145     <refsect2>
146       <title>client_packets_sent</title>
147       <para>
148         Number of packets sent to client processes via unix domain socket.
149       </para>
150     </refsect2>
151
152     <refsect2>
153       <title>client_packets_recv</title>
154       <para>
155         Number of packets received from client processes via unix domain socket.
156       </para>
157     </refsect2>
158
159     <refsect2>
160       <title>node_packets_sent</title>
161       <para>
162         Number of packets sent to the other nodes in the cluster via TCP.
163       </para>
164     </refsect2>
165
166     <refsect2>
167       <title>node_packets_recv</title>
168       <para>
169         Number of packets received from the other nodes in the cluster via TCP.
170       </para>
171     </refsect2>
172
173     <refsect2>
174       <title>keepalive_packets_sent</title>
175       <para>
176         Number of keepalive messages sent to other nodes.
177       </para>
178       <para>
179         CTDB periodically sends keepalive messages to other nodes.
180         See <citetitle>KeepaliveInterval</citetitle> tunable in
181         <citerefentry><refentrytitle>ctdb-tunables</refentrytitle>
182         <manvolnum>7</manvolnum></citerefentry> for more details.
183       </para>
184     </refsect2>
185
186     <refsect2>
187       <title>keepalive_packets_recv</title>
188       <para>
189         Number of keepalive messages received from other nodes.
190       </para>
191     </refsect2>
192
193     <refsect2>
194       <title>node</title>
195       <para>
196         This section lists various types of messages processed which
197         originated from other nodes via TCP.
198       </para>
199
200     <refsect3>
201       <title>req_call</title>
202       <para>
203         Number of REQ_CALL messages from the other nodes.
204       </para>
205     </refsect3>
206
207     <refsect3>
208       <title>reply_call</title>
209       <para>
210         Number of REPLY_CALL messages from the other nodes.
211       </para>
212     </refsect3>
213
214     <refsect3>
215       <title>req_dmaster</title>
216       <para>
217         Number of REQ_DMASTER messages from the other nodes.
218       </para>
219     </refsect3>
220
221     <refsect3>
222       <title>reply_dmaster</title>
223       <para>
224         Number of REPLY_DMASTER messages from the other nodes.
225       </para>
226     </refsect3>
227
228     <refsect3>
229       <title>reply_error</title>
230       <para>
231         Number of REPLY_ERROR messages from the other nodes.
232       </para>
233     </refsect3>
234
235     <refsect3>
236       <title>req_message</title>
237       <para>
238         Number of REQ_MESSAGE messages from the other nodes.
239       </para>
240     </refsect3>
241
242     <refsect3>
243       <title>req_control</title>
244       <para>
245         Number of REQ_CONTROL messages from the other nodes.
246       </para>
247     </refsect3>
248
249     <refsect3>
250       <title>reply_control</title>
251       <para>
252         Number of REPLY_CONTROL messages from the other nodes.
253       </para>
254     </refsect3>
255
256     <refsect3>
257       <title>req_tunnel</title>
258       <para>
259         Number of REQ_TUNNEL messages from the other nodes.
260       </para>
261     </refsect3>
262
263     </refsect2>
264
265     <refsect2>
266       <title>client</title>
267       <para>
268         This section lists various types of messages processed which
269         originated from clients via unix domain socket.
270       </para>
271
272     <refsect3>
273       <title>req_call</title>
274       <para>
275         Number of REQ_CALL messages from the clients.
276       </para>
277     </refsect3>
278
279     <refsect3>
280       <title>req_message</title>
281       <para>
282         Number of REQ_MESSAGE messages from the clients.
283       </para>
284     </refsect3>
285
286     <refsect3>
287       <title>req_control</title>
288       <para>
289         Number of REQ_CONTROL messages from the clients.
290       </para>
291     </refsect3>
292
293     <refsect3>
294       <title>req_tunnel</title>
295       <para>
296         Number of REQ_TUNNEL messages from the clients.
297       </para>
298     </refsect3>
299
300     </refsect2>
301
302     <refsect2>
303       <title>timeouts</title>
304       <para>
305         This section lists timeouts occurred when sending various messages.
306       </para>
307
308     <refsect3>
309       <title>call</title>
310       <para>
311         Number of timeouts for REQ_CALL messages.
312       </para>
313     </refsect3>
314
315     <refsect3>
316       <title>control</title>
317       <para>
318         Number of timeouts for REQ_CONTROL messages.
319       </para>
320     </refsect3>
321
322     <refsect3>
323       <title>traverse</title>
324       <para>
325         Number of timeouts for database traverse operations.
326       </para>
327     </refsect3>
328     </refsect2>
329
330     <refsect2>
331       <title>locks</title>
332       <para>
333         This section lists locking statistics.
334       </para>
335
336     <refsect3>
337       <title>num_calls</title>
338       <para>
339         Number of completed lock calls.  This includes database locks
340         and record locks.
341       </para>
342     </refsect3>
343
344     <refsect3>
345       <title>num_current</title>
346       <para>
347         Number of scheduled lock calls.  This includes database locks
348         and record locks.
349       </para>
350     </refsect3>
351
352     <refsect3>
353       <title>num_pending</title>
354       <para>
355         Number of queued lock calls.  This includes database locks and
356         record locks.
357       </para>
358     </refsect3>
359
360     <refsect3>
361       <title>num_failed</title>
362       <para>
363         Number of failed lock calls.  This includes database locks and
364         record locks.
365       </para>
366     </refsect3>
367
368     </refsect2>
369
370     <refsect2>
371       <title>total_calls</title>
372       <para>
373         Number of req_call messages processed from clients.  This number
374         should be same as client --> req_call.
375       </para>
376     </refsect2>
377
378     <refsect2>
379       <title>pending_calls</title>
380       <para>
381         Number of req_call messages which are currenly being processed.
382         This number indicates the number of record migrations in flight.
383       </para>
384     </refsect2>
385
386     <refsect2>
387       <title>childwrite_calls</title>
388       <para>
389         Number of record update calls.  Record update calls are used to
390         update a record under a transaction.
391       </para>
392     </refsect2>
393
394     <refsect2>
395       <title>pending_childwrite_calls</title>
396       <para>
397         Number of record update calls currently active.
398       </para>
399     </refsect2>
400
401     <refsect2>
402       <title>memory_used</title>
403       <para>
404         The amount of memory in bytes currently used by CTDB using
405         talloc.  This includes all the memory used for CTDB's internal
406         data structures.  This does not include the memory mapped TDB
407         databases.
408       </para>
409     </refsect2>
410
411     <refsect2>
412       <title>max_hop_count</title>
413       <para>
414         The maximum number of hops required for a record migration request
415         to obtain the record.  High numbers indicate record contention.
416       </para>
417     </refsect2>
418
419     <refsect2>
420       <title>total_ro_delegations</title>
421       <para>
422         Number of readonly delegations created.
423       </para>
424     </refsect2>
425
426     <refsect2>
427       <title>total_ro_revokes</title>
428       <para>
429         Number of readonly delegations that were revoked.  The difference
430         between total_ro_revokes and total_ro_delegations gives the
431         number of currently active readonly delegations.
432       </para>
433     </refsect2>
434
435     <refsect2>
436       <title>hop_count_buckets</title>
437       <para>
438         Distribution of migration requests based on hop counts values.
439         Buckets are 1, &lt; 4, &lt; 8, &lt; 16, &lt; 32, &lt; 64, &lt;
440         128, &lt; 256, &lt; 512, &ge; 512.
441       </para>
442     </refsect2>
443
444     <refsect2>
445       <title>lock_buckets</title>
446       <para>
447         Distribution of record lock requests based on time required to
448         obtain locks.  Buckets are &lt; 1ms, &lt; 10ms, &lt; 100ms,
449         &lt; 1s, &lt; 2s, &lt; 4s, &lt; 8s, &lt; 16s, &lt; 32s, &lt;
450         64s, &ge; 64s.
451       </para>
452     </refsect2>
453
454     <refsect2>
455       <title>locks_latency</title>
456       <para>
457         The minimum, the average and the maximum time (in seconds)
458         required to obtain record locks.
459       </para>
460     </refsect2>
461
462     <refsect2>
463       <title>reclock_ctdbd</title>
464       <para>
465         The minimum, the average and the maximum time (in seconds)
466         required to check if recovery lock is still held by recovery
467         daemon when recovery mode is changed.  This check is done in ctdb daemon.
468       </para>
469     </refsect2>
470
471     <refsect2>
472       <title>reclock_recd</title>
473       <para>
474         The minimum, the average and the maximum time (in seconds)
475         required to check if recovery lock is still held by recovery
476         daemon during recovery.  This check is done in recovery daemon.
477       </para>
478     </refsect2>
479
480     <refsect2>
481       <title>call_latency</title>
482       <para>
483         The minimum, the average and the maximum time (in seconds) required
484         to process a REQ_CALL message from client.  This includes the time
485         required to migrate a record from remote node, if the record is
486         not available on the local node.
487       </para>
488     </refsect2>
489
490     <refsect2>
491       <title>childwrite_latency</title>
492       <para>Default: 0</para>
493       <para>
494         The minimum, the average and the maximum time (in seconds)
495         required to update records under a transaction.
496       </para>
497     </refsect2>
498   </refsect1>
499
500   <refsect1>
501     <title>DATABASE STATISTICS</title>
502
503     <para>
504       CTDB maintains per database statistics about important operations.
505       See the <citerefentry><refentrytitle>ctdb</refentrytitle>
506       <manvolnum>1</manvolnum></citerefentry> command
507       <command>dbstatistics</command> for displaying database statistics.
508     </para>
509
510     <refsect2>
511         <title>Example: ctdb dbstatistics notify_index.tdb</title>
512         <screen>
513 DB Statistics: notify_index.tdb
514  ro_delegations                     0
515  ro_revokes                         0
516  locks
517      total                        131
518      failed                         0
519      current                        0
520      pending                        0
521  hop_count_buckets: 9890 5454 26 1 0 0 0 0 0 0 0 0 0 0 0 0
522  lock_buckets: 4 117 10 0 0 0 0 0 0 0 0 0 0 0 0 0
523  locks_latency      MIN/AVG/MAX     0.000683/0.004198/0.014730 sec out of 131
524  Num Hot Keys:     3
525      Count:7 Key:2f636c75737465726673
526      Count:18 Key:2f636c757374657266732f64617461
527      Count:7 Key:2f636c757374657266732f646174612f636c69656e7473
528         </screen>
529     </refsect2>
530
531     <refsect2>
532       <title>DB Statistics</title>
533       <para>
534         Name of the database.
535       </para>
536     </refsect2>
537
538     <refsect2>
539       <title>ro_delegations</title>
540       <para>
541         Number of readonly delegations created in the database.
542       </para>
543     </refsect2>
544
545     <refsect2>
546       <title>ro_revokes</title>
547       <para>
548         Number of readonly delegations revoked.  The difference in
549         ro_delegations and ro_revokes indicates the currently active
550         readonly delegations.
551       </para>
552     </refsect2>
553
554     <refsect2>
555       <title>locks</title>
556       <para>
557         This section lists locking statistics.
558       </para>
559
560     <refsect3>
561       <title>total</title>
562       <para>
563         Number of completed lock calls.  This includes database locks
564         and record locks.
565       </para>
566     </refsect3>
567
568     <refsect3>
569       <title>failed</title>
570       <para>
571         Number of failed lock calls.  This includes database locks and
572         record locks.
573       </para>
574     </refsect3>
575
576     <refsect3>
577       <title>current</title>
578       <para>
579         Number of scheduled lock calls.  This includes database locks
580         and record locks.
581       </para>
582     </refsect3>
583
584     <refsect3>
585       <title>pending</title>
586       <para>
587         Number of queued lock calls.  This includes database locks and
588         record locks.
589       </para>
590     </refsect3>
591
592     </refsect2>
593
594     <refsect2>
595       <title>hop_count_buckets</title>
596       <para>
597         Distribution of migration requests based on hop counts values.
598         Buckets are 1, &lt; 4, &lt; 8, &lt; 16, &lt; 32, &lt; 64, &lt;
599         128, &lt; 256, &lt; 512, &ge; 512.
600       </para>
601     </refsect2>
602
603     <refsect2>
604       <title>lock_buckets</title>
605       <para>
606         Distribution of record lock requests based on time required to
607         obtain locks.  Buckets are &lt; 1ms, &lt; 10ms, &lt; 100ms,
608         &lt; 1s, &lt; 2s, &lt; 4s, &lt; 8s, &lt; 16s, &lt; 32s, &lt;
609         64s, &ge; 64s.
610       </para>
611     </refsect2>
612
613     <refsect2>
614       <title>locks_latency</title>
615       <para>
616         The minimum, the average and the maximum time (in seconds)
617         required to obtain record locks.
618       </para>
619     </refsect2>
620
621     <refsect2>
622       <title>Num Hot Keys</title>
623       <para>
624         Number of contended records determined by hop count.  CTDB keeps
625         track of top 10 hot records and the output shows hex encoded
626         keys for the hot records.
627       </para>
628     </refsect2>
629   </refsect1>
630
631   <refsect1>
632     <title>SEE ALSO</title>
633     <para>
634       <citerefentry><refentrytitle>ctdb</refentrytitle>
635       <manvolnum>1</manvolnum></citerefentry>,
636
637       <citerefentry><refentrytitle>ctdbd</refentrytitle>
638       <manvolnum>1</manvolnum></citerefentry>,
639
640       <citerefentry><refentrytitle>ctdb-tunables</refentrytitle>
641       <manvolnum>7</manvolnum></citerefentry>,
642
643       <ulink url="http://ctdb.samba.org/"/>
644     </para>
645   </refsect1>
646
647   <refentryinfo>
648     <author>
649       <contrib>
650         This documentation was written by
651         Amitay Isaacs,
652         Martin Schwenke
653       </contrib>
654     </author>
655
656     <copyright>
657       <year>2007</year>
658       <holder>Andrew Tridgell</holder>
659       <holder>Ronnie Sahlberg</holder>
660     </copyright>
661     <legalnotice>
662       <para>
663         This program is free software; you can redistribute it and/or
664         modify it under the terms of the GNU General Public License as
665         published by the Free Software Foundation; either version 3 of
666         the License, or (at your option) any later version.
667       </para>
668       <para>
669         This program is distributed in the hope that it will be
670         useful, but WITHOUT ANY WARRANTY; without even the implied
671         warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
672         PURPOSE.  See the GNU General Public License for more details.
673       </para>
674       <para>
675         You should have received a copy of the GNU General Public
676         License along with this program; if not, see
677         <ulink url="http://www.gnu.org/licenses"/>.
678       </para>
679     </legalnotice>
680   </refentryinfo>
681
682 </refentry>
683