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

KV Cache miss ratio derivation can produce values >100%

    XMLWordPrintable

Details

    • Untriaged
    • 0
    • Unknown

    Description

      kv_ep_cache_miss_ratio is a metric derived by ns_server and used for the UI Dashboard.

      It is calculated as:

      get_metric(<<"kv_ep_cache_miss_ratio">>) ->
          percent(_(<<"kv_ep_bg_fetched">>),
                  ?cut(promQL:sum_without([<<"op">>, <<"result">>],
                                          _({[{eq, <<"name">>, <<"kv_ops">>},
                                              {eq, <<"op">>, <<"get">>}]}))), 0);
      

      100 * kv_ep_bg_fetched / kv_ops{op="get"}
      

      kv_ep_bg_fetched is the number of performed BGFetches. kv_ops{op="get"} is the number of "get" operations, which includes GET/GAT/Subdoc Lookup. KV can perform BGFetches for non-get operations. For example, sets can require a BGFetch, if XATTRs are used or if replacement is not allowed.

      I'm not sure what the "cache miss rate" should represent, but I don't think having a value larger than 100% makes sense (there are more cache misses than requests).

      If the intention of the metric is to be specifically looking at get/access operations, it can be replaced with get misses / (miss+hit).

      100 * kv_ops{op="get", result="miss"} / sum without (result) (kv_ops{op="get"})
      

      Attachments

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

        Activity

          People

            ashwin.govindarajulu Ashwin Govindarajulu
            vesko.karaganev Vesko Karaganev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty