Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-6489

Possibility to check btree stats and expose them for view btrees

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 2.0-beta
    • None
    • storage-engine, view-engine
    • Security Level: Public
    • None
    • 1

    Description

      Getting btree statistics (number of nodes, max/min depth, etc) is useful for debugging and performance analysis.

      The ability to consult them via non-public URIs is useful for view-engine and storage-engine engineers.

      Example, when querying the per design doc specific debug URL:

      $ curl -s 'http://localhost:9500/_set_view/default/_design/test3/_btree_stats' | python -mjson.tool
      {
      "id_btree":

      { "avg_elements_per_kp_node": 19.93181818181818, "avg_elements_per_kv_node": 75.00750075007501, "avg_kp_node_size": 3170.159090909091, "avg_kp_node_size_compressed": 454.0511363636364, "avg_kv_node_size": 2101.2100210021, "avg_kv_node_size_compressed": 884.929492949295, "btree_size": 3058201, "chunk_threshold": 5120, "file_size": 11866307, "fragmentation": 74.22786213098988, "kp_nodes": 176, "kv_count": 250000, "kv_nodes": 3333, "max_depth": 4, "max_elements_per_kp_node": 27, "max_elements_per_kv_node": 100, "max_kp_node_size": 4294, "max_kp_node_size_compressed": 619, "max_kv_node_size": 2801, "max_kv_node_size_compressed": 1161, "max_reduction_size": 133, "min_depth": 4, "min_elements_per_kp_node": 8, "min_elements_per_kv_node": 75, "min_kp_node_size": 1273, "min_kp_node_size_compressed": 206, "min_kv_node_size": 2101, "min_kv_node_size_compressed": 849, "min_reduction_size": 133 }

      ,
      "view1":

      { "avg_elements_per_kp_node": 17.96416938110749, "avg_elements_per_kv_node": 23.99923202457521, "avg_kp_node_size": 3127.825732899023, "avg_kp_node_size_compressed": 498.3436482084691, "avg_kv_node_size": 3024.903235096477, "avg_kv_node_size_compressed": 805.7447441681866, "btree_size": 8789820, "chunk_threshold": 5120, "file_size": 11866307, "fragmentation": 25.92623804524862, "kp_nodes": 614, "kv_count": 250000, "kv_nodes": 10417, "max_depth": 5, "max_elements_per_kp_node": 21, "max_elements_per_kv_node": 24, "max_kp_node_size": 3676, "max_kp_node_size_compressed": 606, "max_kv_node_size": 3025, "max_kv_node_size_compressed": 852, "max_reduction_size": 141, "min_depth": 5, "min_elements_per_kp_node": 2, "min_elements_per_kv_node": 16, "min_kp_node_size": 357, "min_kp_node_size_compressed": 108, "min_kv_node_size": 2017, "min_kv_node_size_compressed": 577, "min_reduction_size": 137 }

      }
      $

      Should be used with care, as it needs to traverse all the btrees to collect the statistics, which can take several minutes to several minutes, depending on the size of the trees.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            FilipeManana Filipe Manana (Inactive)
            FilipeManana Filipe Manana (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty