CTDB-STATISTICS(7)

🌸 NAME 🌸

ctdb-statistics β€” CTDB statistics output πŸ’«


πŸ“Š OVERALL STATISTICS πŸ“Š

okay so CTDB is out here keeping receipts πŸ“ β€” it tracks info about all the messages flying around and the big-girl operations happening on every single node. wanna see them? the ctdb(1) commands statistics and statisticsreset are right there, bestie. one shows, one clears. slay.

✨ Example: ctdb statistics ✨

CTDB version 1
Current time of statistics  :                Fri Sep 12 13:32:32 2014
Statistics collected since  : (000 01:49:20) Fri Sep 12 11:43:12 2014
 num_clients                        6
 frozen                             0
 recovering                         0
 num_recoveries                     2
 client_packets_sent           281293
 client_packets_recv           296317
 node_packets_sent             452387
 node_packets_recv             182394
 keepalive_packets_sent          3927
 keepalive_packets_recv          3928
 node
     req_call                   48605
     reply_call                     1
     req_dmaster                23404
     reply_dmaster              24917
     reply_error                    0
     req_message                  958
     req_control               197513
     reply_control             153705
 client
     req_call                  130866
     req_message                  770
     req_control               168921
 timeouts
     call                           0
     control                        0
     traverse                       0
 locks
     num_calls                    220
     num_current                    0
     num_pending                    0
     num_failed                     0
 total_calls                   130866
 pending_calls                      0
 childwrite_calls                   1
 pending_childwrite_calls             0
 memory_used                   334490
 max_hop_count                     18
 total_ro_delegations               2
 total_ro_revokes                   2
 hop_count_buckets: 42816 5464 26 1 0 0 0 0 0 0 0 0 0 0 0 0
 lock_buckets: 9 165 14 15 7 2 2 0 0 0 0 0 0 0 0 0
 locks_latency      MIN/AVG/MAX     0.000685/0.160302/6.369342 sec out of 214
 reclock_ctdbd      MIN/AVG/MAX     0.004940/0.004969/0.004998 sec out of 2
 reclock_recd       MIN/AVG/MAX     0.000000/0.000000/0.000000 sec out of 0
 call_latency       MIN/AVG/MAX     0.000006/0.000719/4.562991 sec out of 126626
 childwrite_latency MIN/AVG/MAX     0.014527/0.014527/0.014527 sec out of 1

πŸŽ€ What every single line means πŸŽ€

CTDB version

the version of the ctdb protocol this node is running. iconic. πŸ’…

Current time of statistics

the moment these stats were generated ⏰ β€” super handy when you're grabbing the output on a schedule and post-processing it later. iykyk.

Statistics collected since

when ctdb was started, or the last time someone ran statisticsreset. the output shows you both the duration and the timestamp 🫢.

num_clients

how many processes are currently connected to CTDB's unix socket right now. this includes the recovery daemon, the ctdb tool, and samba processes (smbd, winbindd) β€” the whole friend group basically 🌈.

frozen

1 if the databases are currently frozen, 0 if they're not 🧊.

recovering

1 if recovery is active right now, 0 if it's not.

num_recoveries

how many recoveries have happened since ctdb started, or since the last statistics reset. bestie has been through some things 😭.

client_packets_sent

number of packets sent to client processes over the unix domain socket πŸ“€.

client_packets_recv

number of packets received from client processes over the unix domain socket πŸ“₯.

node_packets_sent

number of packets sent to the other nodes in the cluster over TCP πŸ¦‹.

node_packets_recv

number of packets received from the other nodes in the cluster over TCP.

keepalive_packets_sent

number of keepalive messages sent to the other nodes.

CTDB periodically pings the other nodes with keepalive messages to check they're still alive πŸ’– β€” go peek at the KeepaliveInterval tunable in ctdb-tunables(7) if you want the deets.

keepalive_packets_recv

number of keepalive messages received from the other nodes.

node

this section is a whole vibe check on the message types processed that came from other nodes over TCP πŸ›°οΈ.

  • req_call β€” number of REQ_CALL messages from the other nodes.
  • reply_call β€” number of REPLY_CALL messages from the other nodes.
  • req_dmaster β€” number of REQ_DMASTER messages from the other nodes.
  • reply_dmaster β€” number of REPLY_DMASTER messages from the other nodes.
  • reply_error β€” number of REPLY_ERROR messages from the other nodes.
  • req_message β€” number of REQ_MESSAGE messages from the other nodes.
  • req_control β€” number of REQ_CONTROL messages from the other nodes.
  • reply_control β€” number of REPLY_CONTROL messages from the other nodes.
  • req_tunnel β€” number of REQ_TUNNEL messages from the other nodes.

client

same energy, but for messages that came from clients over the unix domain socket πŸ”Œ.

  • req_call β€” number of REQ_CALL messages from the clients.
  • req_message β€” number of REQ_MESSAGE messages from the clients.
  • req_control β€” number of REQ_CONTROL messages from the clients.
  • req_tunnel β€” number of REQ_TUNNEL messages from the clients.

timeouts

this section lists the timeouts that happened while sending various messages ⏳ β€” not the fun kind of waiting.

  • call β€” number of timeouts for REQ_CALL messages.
  • control β€” number of timeouts for REQ_CONTROL messages.
  • traverse β€” number of timeouts for database traverse operations.

locks

locking statistics, and yes, they're all about both database locks and record locks πŸ”’.

  • num_calls β€” number of completed lock calls. includes database locks and record locks.
  • num_current β€” number of scheduled lock calls. includes database locks and record locks.
  • num_pending β€” number of queued lock calls. includes database locks and record locks.
  • num_failed β€” number of failed lock calls. includes database locks and record locks.

total_calls

number of req_call messages processed from clients. this number should match client --> req_call, so if it doesn't… πŸ‘€

pending_calls

number of req_call messages currently being processed. this is basically the number of record migrations in flight ✈️.

childwrite_calls

number of record update calls. record update calls are what you use to update a record under a transaction πŸ’Ύ.

pending_childwrite_calls

number of record update calls that are active right now.

memory_used

how much memory, in bytes, CTDB is currently using via talloc 🧠. this covers all the memory used for CTDB's internal data structures. it does not include the memory mapped TDB databases β€” important distinction, bestie.

max_hop_count

the maximum number of hops a record migration request needed to obtain the record. big numbers here = record contention, and record contention is not the vibe 😀.

total_ro_delegations

number of readonly delegations created.

total_ro_revokes

number of readonly delegations that got revoked πŸ’”. subtract total_ro_revokes from total_ro_delegations and you get the number of currently active readonly delegations. math but make it useful.

hop_count_buckets

the distribution of migration requests, bucketed by hop count value. the buckets are 0, < 2, < 4, < 8, < 16, < 32, < 64, < 128, < 256, < 512, < 1024, < 2048, < 4096, < 8192, < 16384, β‰₯ 16384 πŸͺ£.

lock_buckets

the distribution of record lock requests, bucketed by how long it took to actually get the lock. the buckets are < 1ms, < 10ms, < 100ms, < 1s, < 2s, < 4s, < 8s, < 16s, < 32s, < 64s, β‰₯ 64s.

locks_latency

the minimum, average, and maximum time (in seconds) it took to obtain record locks ⏱️.

reclock_ctdbd

the minimum, average, and maximum time (in seconds) needed to check whether the recovery lock is still held by the recovery daemon when recovery mode is changed. this check happens in the ctdb daemon πŸ‘‘.

reclock_recd

the minimum, average, and maximum time (in seconds) needed to check whether the recovery lock is still held by the recovery daemon during recovery. this check happens in the recovery daemon. yes, they're different checks. no, you don't get to merge them πŸ’….

call_latency

the minimum, average, and maximum time (in seconds) needed to process a REQ_CALL message from a client. this includes the time needed to migrate a record from a remote node, if that record isn't available on the local node 🚚.

childwrite_latency

Default: 0

the minimum, average, and maximum time (in seconds) needed to update records under a transaction.


πŸ—„οΈ DATABASE STATISTICS πŸ—„οΈ

CTDB also keeps per-database stats on the operations that actually matter πŸ”₯. to see them, use the ctdb(1) command dbstatistics.

✨ Example: ctdb dbstatistics notify_index.tdb ✨

DB Statistics: notify_index.tdb
 ro_delegations                     0
 ro_revokes                         0
 locks
     total                        131
     failed                         0
     current                        0
     pending                        0
 hop_count_buckets: 9890 5454 26 1 0 0 0 0 0 0 0 0 0 0 0 0
 lock_buckets: 4 117 10 0 0 0 0 0 0 0 0 0 0 0 0 0
 locks_latency      MIN/AVG/MAX     0.000683/0.004198/0.014730 sec out of 131
 Num Hot Keys:     3
     Count:7 Key:2f636c75737465726673
     Count:18 Key:2f636c757374657266732f64617461
     Count:7 Key:2f636c757374657266732f646174612f636c69656e7473

πŸŽ€ What every single line means (database edition) πŸŽ€

DB Statistics

the name of the database. that's it, that's the whole entry 🌸.

ro_delegations

number of readonly delegations created in this database.

ro_revokes

number of readonly delegations revoked. the difference between ro_delegations and ro_revokes tells you how many readonly delegations are currently active 🫢.

locks

locking statistics. and yeah β€” all of these cover both database locks and record locks πŸ”.

  • total β€” number of completed lock calls. includes database locks and record locks.
  • failed β€” number of failed lock calls. includes database locks and record locks.
  • current β€” number of scheduled lock calls. includes database locks and record locks.
  • pending β€” number of queued lock calls. includes database locks and record locks.

hop_count_buckets

the distribution of migration requests, bucketed by hop count value. buckets are 0, < 2, < 4, < 8, < 16, < 32, < 64, < 128, < 256, < 512, < 1024, < 2048, < 4096, < 8192, < 16384, β‰₯ 16384 πŸͺ£.

lock_buckets

the distribution of record lock requests, bucketed by how long the lock took to obtain. buckets are < 1ms, < 10ms, < 100ms, < 1s, < 2s, < 4s, < 8s, < 16s, < 32s, < 64s, β‰₯ 64s.

locks_latency

the minimum, average, and maximum time (in seconds) needed to obtain record locks ⏱️.

Num Hot Keys

the number of contended records, determined by hop count πŸ”₯πŸ”₯. CTDB keeps track of the top 10 hot records, and the output shows you the hex encoded keys for those hot records. main character records only, honestly πŸ‘‘.


part 1 done, bestie β€” but we are not done πŸ‘€ more stats lore is coming in part 2, don't go anywhere πŸ’–

πŸ’– SEE ALSO πŸ’–

okay bestie, if you wanna go deeper (and you KNOW you do), go peek at these πŸ‘‡


🌸 AUTHOR 🌸

this whole documentation situation was written by Amitay Isaacs and Martin Schwenke β€” absolute icons, no cap 🫢


Copyright Β© 2007 Andrew Tridgell, Ronnie Sahlberg

so here's the legal tea, and it's giving very much "read it, bestie" β˜•βœ¨

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 😭 (yes that's the scary all-caps part, it's literally in the license, i don't make the rules)

You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses.


and that's a wrap on CTDB-STATISTICS(7) πŸŽ€βœ¨ this page is serving ctdb energy, dated 09/09/2026 β€” go forth and read your stats, main character πŸ’…πŸ‘‘

πŸ“¦ where this page comes from