Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-26

160% cpu load when connecting to dp4 through java client.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.1dp
    • Fix Version/s: None
    • Component/s: Core
    • Security Level: Public
    • Labels:
      None
    • Environment:

      Description

      presales customer is connecting 1.1dp java client to dp4 and seeing 160% cpu load.

      With the older client jars against dp3 they were seeing 100-120% cpu load.

      This cpu load is right after application start with no load at all, after connecting to couchbase.

      from customer:
      "This issue specifically in DP3: http://www.couchbase.com/forums/thread/high-cpu-load-even-when-java-database-client-idle We've been seeing this both on mac and ubuntu."

      1. ViewConnection.java
        10 kB
        Alan Wood
      2. ViewNode-HighCPU.patch
        2 kB
        Velasticus
      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        alex Alex Ma created issue -
        Hide
        alex Alex Ma added a comment -

        Hi Rags,

        Just wondering if there was any update on this ticket?

        thanks

        -Alex

        Show
        alex Alex Ma added a comment - Hi Rags, Just wondering if there was any update on this ticket? thanks -Alex
        Hide
        Velasticus Velasticus added a comment -

        I can confirm this happens in my java app as well. The problem is in the ViewConnection/ViewNode thread that sits in a tight loop when there is nothing to process. This patch adds a timeout to the poll method which reduces CPU down to almost zero.

        Show
        Velasticus Velasticus added a comment - I can confirm this happens in my java app as well. The problem is in the ViewConnection/ViewNode thread that sits in a tight loop when there is nothing to process. This patch adds a timeout to the poll method which reduces CPU down to almost zero.
        Velasticus Velasticus made changes -
        Field Original Value New Value
        Attachment ViewNode-HighCPU.patch [ 12676 ]
        Hide
        drakmir Alan Wood added a comment - - edited

        Added a new version of "View Connection" to combat the 100% cpu issue.

        This version of "View Connection" will block when nothing is happening. It also doesn't block shutdown. Seems to work both when the view connection is "idle" and when it is returning view work. The previous patch had issues with shutdown and possibly with nodes not having work blocking other nodes.

        Show
        drakmir Alan Wood added a comment - - edited Added a new version of "View Connection" to combat the 100% cpu issue. This version of "View Connection" will block when nothing is happening. It also doesn't block shutdown. Seems to work both when the view connection is "idle" and when it is returning view work. The previous patch had issues with shutdown and possibly with nodes not having work blocking other nodes.
        drakmir Alan Wood made changes -
        Attachment ViewConnection.java [ 13014 ]
        Hide
        mikew Mike Wiederhold added a comment -

        Duplicate of JCBC-20. I have a change in review that fixes this issue. I will get it through review next week.

        Show
        mikew Mike Wiederhold added a comment - Duplicate of JCBC-20 . I have a change in review that fixes this issue. I will get it through review next week.
        mikew Mike Wiederhold made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Duplicate [ 3 ]
        ingenthr Matt Ingenthron made changes -
        Workflow jira [ 16384 ] Couchbase SDK Workflow [ 38311 ]

          People

          • Assignee:
            rags Raghavan Srinivas (Inactive)
            Reporter:
            alex Alex Ma
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes