ctdb-daemon: Divide by 2 when calculating hop count bucket
[bbaumbach/samba-autobuild/.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 0, &lt;&nbsp;2, &lt;&nbsp;4, &lt;&nbsp;8,
440         &lt;&nbsp;16, &lt;&nbsp;32, &lt;&nbsp;64, &lt;&nbsp;128,
441         &lt;&nbsp;256, &lt;&nbsp;512, &lt;&nbsp;1024, &lt;&nbsp;2048,
442         &lt;&nbsp;4096, &lt;&nbsp;8192, &lt;&nbsp;16384, &ge;&nbsp;16384.
443       </para>
444     </refsect2>
445
446     <refsect2>
447       <title>lock_buckets</title>
448       <para>
449         Distribution of record lock requests based on time required to
450         obtain locks.  Buckets are &lt; 1ms, &lt; 10ms, &lt; 100ms,
451         &lt; 1s, &lt; 2s, &lt; 4s, &lt; 8s, &lt; 16s, &lt; 32s, &lt;
452         64s, &ge; 64s.
453       </para>
454     </refsect2>
455
456     <refsect2>
457       <title>locks_latency</title>
458       <para>
459         The minimum, the average and the maximum time (in seconds)
460         required to obtain record locks.
461       </para>
462     </refsect2>
463
464     <refsect2>
465       <title>reclock_ctdbd</title>
466       <para>
467         The minimum, the average and the maximum time (in seconds)
468         required to check if recovery lock is still held by recovery
469         daemon when recovery mode is changed.  This check is done in ctdb daemon.
470       </para>
471     </refsect2>
472
473     <refsect2>
474       <title>reclock_recd</title>
475       <para>
476         The minimum, the average and the maximum time (in seconds)
477         required to check if recovery lock is still held by recovery
478         daemon during recovery.  This check is done in recovery daemon.
479       </para>
480     </refsect2>
481
482     <refsect2>
483       <title>call_latency</title>
484       <para>
485         The minimum, the average and the maximum time (in seconds) required
486         to process a REQ_CALL message from client.  This includes the time
487         required to migrate a record from remote node, if the record is
488         not available on the local node.
489       </para>
490     </refsect2>
491
492     <refsect2>
493       <title>childwrite_latency</title>
494       <para>Default: 0</para>
495       <para>
496         The minimum, the average and the maximum time (in seconds)
497         required to update records under a transaction.
498       </para>
499     </refsect2>
500   </refsect1>
501
502   <refsect1>
503     <title>DATABASE STATISTICS</title>
504
505     <para>
506       CTDB maintains per database statistics about important operations.
507       See the <citerefentry><refentrytitle>ctdb</refentrytitle>
508       <manvolnum>1</manvolnum></citerefentry> command
509       <command>dbstatistics</command> for displaying database statistics.
510     </para>
511
512     <refsect2>
513         <title>Example: ctdb dbstatistics notify_index.tdb</title>
514         <screen>
515 DB Statistics: notify_index.tdb
516  ro_delegations                     0
517  ro_revokes                         0
518  locks
519      total                        131
520      failed                         0
521      current                        0
522      pending                        0
523  hop_count_buckets: 9890 5454 26 1 0 0 0 0 0 0 0 0 0 0 0 0
524  lock_buckets: 4 117 10 0 0 0 0 0 0 0 0 0 0 0 0 0
525  locks_latency      MIN/AVG/MAX     0.000683/0.004198/0.014730 sec out of 131
526  Num Hot Keys:     3
527      Count:7 Key:2f636c75737465726673
528      Count:18 Key:2f636c757374657266732f64617461
529      Count:7 Key:2f636c757374657266732f646174612f636c69656e7473
530         </screen>
531     </refsect2>
532
533     <refsect2>
534       <title>DB Statistics</title>
535       <para>
536         Name of the database.
537       </para>
538     </refsect2>
539
540     <refsect2>
541       <title>ro_delegations</title>
542       <para>
543         Number of readonly delegations created in the database.
544       </para>
545     </refsect2>
546
547     <refsect2>
548       <title>ro_revokes</title>
549       <para>
550         Number of readonly delegations revoked.  The difference in
551         ro_delegations and ro_revokes indicates the currently active
552         readonly delegations.
553       </para>
554     </refsect2>
555
556     <refsect2>
557       <title>locks</title>
558       <para>
559         This section lists locking statistics.
560       </para>
561
562     <refsect3>
563       <title>total</title>
564       <para>
565         Number of completed lock calls.  This includes database locks
566         and record locks.
567       </para>
568     </refsect3>
569
570     <refsect3>
571       <title>failed</title>
572       <para>
573         Number of failed lock calls.  This includes database locks and
574         record locks.
575       </para>
576     </refsect3>
577
578     <refsect3>
579       <title>current</title>
580       <para>
581         Number of scheduled lock calls.  This includes database locks
582         and record locks.
583       </para>
584     </refsect3>
585
586     <refsect3>
587       <title>pending</title>
588       <para>
589         Number of queued lock calls.  This includes database locks and
590         record locks.
591       </para>
592     </refsect3>
593
594     </refsect2>
595
596     <refsect2>
597       <title>hop_count_buckets</title>
598       <para>
599         Distribution of migration requests based on hop counts values.
600         Buckets are 0, &lt;&nbsp;2, &lt;&nbsp;4, &lt;&nbsp;8,
601         &lt;&nbsp;16, &lt;&nbsp;32, &lt;&nbsp;64, &lt;&nbsp;128,
602         &lt;&nbsp;256, &lt;&nbsp;512, &lt;&nbsp;1024, &lt;&nbsp;2048,
603         &lt;&nbsp;4096, &lt;&nbsp;8192, &lt;&nbsp;16384, &ge;&nbsp;16384.
604       </para>
605     </refsect2>
606
607     <refsect2>
608       <title>lock_buckets</title>
609       <para>
610         Distribution of record lock requests based on time required to
611         obtain locks.  Buckets are &lt; 1ms, &lt; 10ms, &lt; 100ms,
612         &lt; 1s, &lt; 2s, &lt; 4s, &lt; 8s, &lt; 16s, &lt; 32s, &lt;
613         64s, &ge; 64s.
614       </para>
615     </refsect2>
616
617     <refsect2>
618       <title>locks_latency</title>
619       <para>
620         The minimum, the average and the maximum time (in seconds)
621         required to obtain record locks.
622       </para>
623     </refsect2>
624
625     <refsect2>
626       <title>Num Hot Keys</title>
627       <para>
628         Number of contended records determined by hop count.  CTDB keeps
629         track of top 10 hot records and the output shows hex encoded
630         keys for the hot records.
631       </para>
632     </refsect2>
633   </refsect1>
634
635   <refsect1>
636     <title>SEE ALSO</title>
637     <para>
638       <citerefentry><refentrytitle>ctdb</refentrytitle>
639       <manvolnum>1</manvolnum></citerefentry>,
640
641       <citerefentry><refentrytitle>ctdbd</refentrytitle>
642       <manvolnum>1</manvolnum></citerefentry>,
643
644       <citerefentry><refentrytitle>ctdb-tunables</refentrytitle>
645       <manvolnum>7</manvolnum></citerefentry>,
646
647       <ulink url="http://ctdb.samba.org/"/>
648     </para>
649   </refsect1>
650
651   <refentryinfo>
652     <author>
653       <contrib>
654         This documentation was written by
655         Amitay Isaacs,
656         Martin Schwenke
657       </contrib>
658     </author>
659
660     <copyright>
661       <year>2007</year>
662       <holder>Andrew Tridgell</holder>
663       <holder>Ronnie Sahlberg</holder>
664     </copyright>
665     <legalnotice>
666       <para>
667         This program is free software; you can redistribute it and/or
668         modify it under the terms of the GNU General Public License as
669         published by the Free Software Foundation; either version 3 of
670         the License, or (at your option) any later version.
671       </para>
672       <para>
673         This program is distributed in the hope that it will be
674         useful, but WITHOUT ANY WARRANTY; without even the implied
675         warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
676         PURPOSE.  See the GNU General Public License for more details.
677       </para>
678       <para>
679         You should have received a copy of the GNU General Public
680         License along with this program; if not, see
681         <ulink url="http://www.gnu.org/licenses"/>.
682       </para>
683     </legalnotice>
684   </refentryinfo>
685
686 </refentry>
687