Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-439

Investigate incorrect CPU usage stats

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 2.7.0
    • Component/s: SyncGateway
    • Security Level: Public
    • Labels:
      None
    • Sprint:
      CBG Sprint 26
    • Story Points:
      5

      Description

      During perf testing on a 48 core machine, one perf stat measuring the CPU usage via top was showing ~4000% (i.e. all cores running at ~85%)

      However, the process_cpu_percent_utilization stat, was only ever showing about 800%

      After looking at the code that calculates this stat a little (calculateProcessCpuPercentage), it's non-trivial, so we need to verify it's doing the right thing, and determine the reason for the huge difference above.

        Attachments

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

          Activity

          Hide
          jacques.rascagneres Jacques Rascagneres added a comment - - edited

          Following discussion we will leave the stat as is. It appears that it is missing a number of components which are used in top to calculate the CPU usage. The calculation used by a proposed library is as follows:

          c.User + c.System + c.Nice + c.Iowait + c.Irq + c.Softirq + c.Steal + c.Guest + c.GuestNice + c.Idle + c.Stolen, however, we appear to be only counting the user and system stat.

          A fix to include these other components is on branch CBG-439-3, however, as it uses a different library and also a new dependency (for windows support) we are not putting this change in for now.  

          A DOC ticket to make customers aware that this calculation only takes into account user and system time is tracked as DOC-5499

          Show
          jacques.rascagneres Jacques Rascagneres added a comment - - edited Following discussion we will leave the stat as is. It appears that it is missing a number of components which are used in top to calculate the CPU usage. The calculation used by a proposed library is as follows: c.User + c.System + c.Nice + c.Iowait + c.Irq + c.Softirq + c.Steal + c.Guest + c.GuestNice + c.Idle + c.Stolen , however, we appear to be only counting the user and system stat. A fix to include these other components is on branch CBG-439-3 , however, as it uses a different library and also a new dependency (for windows support) we are not putting this change in for now.   A DOC ticket to make customers aware that this calculation only takes into account user and system time is tracked as DOC-5499

            People

            Assignee:
            jacques.rascagneres Jacques Rascagneres
            Reporter:
            ben.brooks Ben Brooks
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes

                  PagerDuty