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

Use frag_percent, avg_item_size from indexer stats rather than ns_server calculating the values

    XMLWordPrintable

Details

    • Untriaged
    • Unknown

    Description

      Currently, ns_server is using it's own calculation for computing "frag_percent" and "avg_item_size" values. Both these stats are dependent on data_size stat value. Any change to indexer data_size stat will impact the "frag_percent" and "avg_item_size" values. Also, "frag_percent" depends on "disk_size" value which has been changed as a part of MB-31787. This led to reporting incorrect fragmentation percentage on the UI (MB-36613)

      Instead of ns_server calculating these values, please use the values from indexer stats. Indexer periodic stats already exposes "frag_percent" stat. From build 6.5.0-4750, another stat "avg_item_size" is also exposed

      Attachments

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

        Activity

          Varun Velamuri, I think that the fragmention calculation you provided is incorrect. Can you please confirm?

          The way I understand the stats, data_size_on_disk is the size of valid data on disk, while log_space_on_disk is more or less the total size of disk storage being used (by valid data and garbage). So in the fully compacted case where there's no garbage on disk, you'd expect to see data_size_on_disk be equal to log_space_on_disk. You'd also expect to see no fragmentation (or 0%). Your calculation, though, will give a fragmentation of 100%.

          Aliaksey Artamonau Aliaksey Artamonau (Inactive) added a comment - Varun Velamuri , I think that the fragmention calculation you provided is incorrect. Can you please confirm? The way I understand the stats, data_size_on_disk is the size of valid data on disk, while log_space_on_disk is more or less the total size of disk storage being used (by valid data and garbage). So in the fully compacted case where there's no garbage on disk, you'd expect to see data_size_on_disk be equal to log_space_on_disk . You'd also expect to see no fragmentation (or 0%). Your calculation, though, will give a fragmentation of 100%.

          Build couchbase-server-6.5.0-4844 contains ns_server commit 479702c with commit message:
          MB-36754 Use indexer provided stats in calculations

          build-team Couchbase Build Team added a comment - Build couchbase-server-6.5.0-4844 contains ns_server commit 479702c with commit message: MB-36754 Use indexer provided stats in calculations

          Aliaksey Artamonau, You are right. I am wrong with my calculation. Fragmentation is ((log_space_on_disk - data_size_on_disk)/log_space_on_disk). Thanks for pointing this out.

          varun.velamuri Varun Velamuri added a comment - Aliaksey Artamonau , You are right. I am wrong with my calculation. Fragmentation is  ((log_space_on_disk - data_size_on_disk)/log_space_on_disk) . Thanks for pointing this out.

          Build couchbase-server-7.0.0-1050 contains ns_server commit 479702c with commit message:
          MB-36754 Use indexer provided stats in calculations

          build-team Couchbase Build Team added a comment - Build couchbase-server-7.0.0-1050 contains ns_server commit 479702c with commit message: MB-36754 Use indexer provided stats in calculations

          Verified on 6.5.0-4960

          mihir.kamdar Mihir Kamdar (Inactive) added a comment - Verified on 6.5.0-4960

          People

            mihir.kamdar Mihir Kamdar (Inactive)
            varun.velamuri Varun Velamuri
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty