Skip to content

OpenShift eating my CPU #5355

Closed
Closed

Description

@mfojtik

When I run the latest OSE image in Docker container, everything works normally but after some time and after I start some builds and deploy stuff the "openshift" process start eating >100% CPU and it keeps doing that until I stop the container. This sometimes takes couple minutes to happen, sometimes it happens in few seconds...

Here is heap dump: http://omicron.mifo.sk/heap.txt
Here is goroutine dump: http://omicron.mifo.sk/go.txt
And here is loglevel=5 openshift log: http://omicron.mifo.sk/ose.txt

[vagrant@localhost ~]$ docker run openshift3/ose version
openshift v3.0.2.902
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4
etcd 2.1.2

The container is started like this (on the RHEL 7.1 VM with docker 1.7.1:

$ docker run -d --name "ose" --privileged --net=host --pid=host \
  -v /:/rootfs:ro \
  -v /var/run:/var/run:rw \
  -v /sys:/sys:ro \
  -v /var/lib/docker:/var/lib/docker:rw \
  -v #{ORIGIN_DIR}/openshift.local.volumes:#{ORIGIN_DIR}/openshift.local.volumes:z \
  -v #{ORIGIN_DIR}/openshift.local.config:#{ORIGIN_DIR}/openshift.local.config:z \
  -v #{ORIGIN_DIR}/openshift.local.etcd:#{ORIGIN_DIR}/openshift.local.etcd:z \
  openshift3/ose start \
   --master="https://#{PUBLIC_ADDRESS}:8443" \
   --etcd-dir="#{ORIGIN_DIR}/openshift.local.etcd"
PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
24806 root      20   0 1456368 240616  19092 S 193.4 12.8   2:46.28 openshift 

The registry and router are also installed and running properly.

It seems like something got stuck on decoding/encoding JSON, but I can't see anything in the container logs...

@smarterclayton @deads2k FYI

(since this is very reproducible and it is happening with the OSE Docker image, this should get P1?)

Activity

  1. hferentschik commented on Oct 23, 2015

    @hferentschik
    Contributor

    +1 I have been experiencing the same. The only way to move on was to restart the container

  2. mfojtik commented on Oct 23, 2015

    @mfojtik
    ContributorAuthor
  3. liggitt commented on Oct 23, 2015

    @liggitt
    Contributor

    Are you running the all in one, or can you tell whether it is the master or node process that is eating CPU?

  4. mfojtik commented on Oct 23, 2015

    @mfojtik
    ContributorAuthor

    @liggitt all-in-one

  5. added
    kind/bug
    on Oct 23, 2015
  6. smarterclayton commented on Oct 23, 2015

    @smarterclayton
    Contributor

    Please capture a CPU dump

    On Fri, Oct 23, 2015 at 7:24 AM, Michal Fojtik [email protected]
    wrote:

    @liggitt https://github.com/liggitt all-in-one

    —
    Reply to this email directly or view it on GitHub
    #5355 (comment).

  7. maxandersen commented on Oct 26, 2015

    @maxandersen
    Contributor

    @smarterclayton sorry for my ignorance but what kind of CPU dump would like to have ? is a plain top dump enough ?

  8. smarterclayton commented on Oct 26, 2015

    @smarterclayton
    Contributor

    Michal's on vacation unfortunately so I was mostly asking him - basically a
    CPU profile from OpenShift when at 100% CPU so we can see what's hot. I
    don't think this is something you have to gather, whomever ends up owning
    this will need to recreate and verify.

    On Mon, Oct 26, 2015 at 11:19 AM, Max Rydahl Andersen <
    [email protected]> wrote:

    @smarterclayton https://github.com/smarterclayton sorry for my
    ignorance but what kind of CPU dump would like to have ? is a plain top
    dump enough ?

    —
    Reply to this email directly or view it on GitHub
    #5355 (comment).

  9. maxandersen commented on Oct 26, 2015

    @maxandersen
    Contributor

    okey.

  10. liggitt commented on Oct 26, 2015

    @liggitt
    Contributor

    Were you following build logs in the CLI or the web console? Seeing 250% CPU usage after viewing logs in the web console. I did this:

    1. Start openshift
    2. Run a build, letting it complete successfully and deploy
    3. View logs for the completed build in the web console.
    4. Logs took about 25 seconds to load, then the server process went to 250% CPU and I saw this in the server log:
    I1026 12:22:41.723533   10467 server.go:1064] GET /containerLogs/bob/mynode-2-build/sti-build?follow=true: (2.11698ms) 500
    goroutine 2627 [running]:
    k8s.io/kubernetes/pkg/httplog.(*respLogger).WriteHeader(0xc20e4ac480, 0x1f4)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/httplog/log.go:188 +0x9a
    github.com/emicklei/go-restful.(*Response).WriteErrorString(0xc20e4ac7e0, 0x1f4, 0xc20e5cd340, 0x40, 0x0, 0x0)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/emicklei/go-restful/response.go:199 +0x5a
    github.com/emicklei/go-restful.(*Response).WriteError(0xc20e4ac7e0, 0x1f4, 0x7fe448204700, 0xc20a4ad480, 0x0, 0x0)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/emicklei/go-restful/response.go:187 +0xa8
    k8s.io/kubernetes/pkg/kubelet.(*Server).getContainerLogs(0xc209155800, 0xc20ecf8c90, 0xc20e4ac7e0)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/kubelet/server.go:477 +0x1440
    k8s.io/kubernetes/pkg/kubelet.*Server.(k8s.io/kubernetes/pkg/kubelet.getContainerLogs)·fm(0xc20ecf8c90, 0xc20e4ac7e0)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/kubelet/server.go:317 +0x3b
    github.com/emicklei/go-restful.func·009(0xc20ecf8c90, 0xc20e4ac7e0)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/emicklei/go-restful/container.go:244 +0x41
    github.com/emicklei/go-restful.(*FilterChain).ProcessFilter(0xc20ecf8d20, 0xc20ecf8c90, 0xc20e4ac7e0)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/emicklei/go-restful/filter.go:21 +0xa2
    k8s.io/kubernetes/pkg/kubelet.func·019(0xc20ecf8c90, 0xc20e4ac7e0, 0xc20ecf8d20)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/kubelet/server.go:207 +0x6e1
    github.com/emicklei/go-restful.(*FilterChain).ProcessFilter(0xc20ecf8d20, 0xc20ecf8c90, 0xc20e4ac7e0)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/emicklei/go-restful/filter.go:19 +0x84
    github.com/emicklei/go-restfu [[Go 1.1 package http] 127.0.0.1:38051]
    2015-10-26 12:22:41.723634 I | http: WriteHeader called with both Transfer-Encoding of "chunked" and a Content-Length of 64
    I1026 12:22:41.743989   10467 node_auth.go:142] Node request attributes: namespace=, user=system:openshift-node-admin, groups=[system:node-admins system:authenticated], attrs=authorizer.DefaultAuthorizationAttributes{Verb:"proxy", APIVersion:"v1", APIGroup:"", Resource:"nodes", ResourceName:"jliggitt-laptop", RequestAttributes:interface {}(nil), NonResourceURL:false, URL:"/containerLogs/bob/mynode-2-build/sti-build"}
    I1026 12:22:41.744096   10467 authorizer.go:30] allowed=true, reason=allowed by cluster rule
    I1026 12:22:41.744299   10467 server.go:1064] GET /containerLogs/bob/mynode-2-build/sti-build?follow=true: (553.331µs) 500
    goroutine 2627 [running]:
    k8s.io/kubernetes/pkg/httplog.(*respLogger).WriteHeader(0xc20ddcd500, 0x1f4)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/httplog/log.go:188 +0x9a
    github.com/emicklei/go-restful.(*Response).WriteErrorString(0xc20ddcd560, 0x1f4, 0xc20ac8b200, 0x40, 0x0, 0x0)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/emicklei/go-restful/response.go:199 +0x5a
    github.com/emicklei/go-restful.(*Response).WriteError(0xc20ddcd560, 0x1f4, 0x7fe448204700, 0xc20ece80b0, 0x0, 0x0)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/emicklei/go-restful/response.go:187 +0xa8
    k8s.io/kubernetes/pkg/kubelet.(*Server).getContainerLogs(0xc209155800, 0xc20d65e720, 0xc20ddcd560)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/kubelet/server.go:477 +0x1440
    k8s.io/kubernetes/pkg/kubelet.*Server.(k8s.io/kubernetes/pkg/kubelet.getContainerLogs)·fm(0xc20d65e720, 0xc20ddcd560)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/kubelet/server.go:317 +0x3b
    github.com/emicklei/go-restful.func·009(0xc20d65e720, 0xc20ddcd560)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/emicklei/go-restful/container.go:244 +0x41
    github.com/emicklei/go-restful.(*FilterChain).ProcessFilter(0xc20d65e7b0, 0xc20d65e720, 0xc20ddcd560)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/emicklei/go-restful/filter.go:21 +0xa2
    k8s.io/kubernetes/pkg/kubelet.func·019(0xc20d65e720, 0xc20ddcd560, 0xc20d65e7b0)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/kubelet/server.go:207 +0x6e1
    github.com/emicklei/go-restful.(*FilterChain).ProcessFilter(0xc20d65e7b0, 0xc20d65e720, 0xc20ddcd560)
        /home/jliggitt/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/emicklei/go-restful/filter.go:19 +0x84
    
  11. liggitt commented on Oct 26, 2015

    @liggitt
    Contributor

    Captured profile by starting with OPENSHIFT_PROFILE=web, and grabbing with go tool pprof http://localhost:6060/debug/pprof/profile when at 250% CPU:

    profile

  12. smarterclayton commented on Oct 26, 2015

    @smarterclayton
    Contributor

    Suspect this is a hot read loop for zero byte reads in the websocket code.

    On Mon, Oct 26, 2015 at 12:30 PM, Jordan Liggitt [email protected]
    wrote:

    Captured profile by starting with OPENSHIFT_PROFILE=web, and grabbing
    with go tool pprof http://localhost:6060/debug/pprof/profile when at 250%
    CPU:

    [image: profile]
    https://cloud.githubusercontent.com/assets/980082/10735223/5cf77118-7bdd-11e5-889c-0727910bec5f.png

    —
    Reply to this email directly or view it on GitHub
    #5355 (comment).

  13. smarterclayton commented on Oct 26, 2015

    @smarterclayton
    Contributor

    Need to isolate where this is caused by a websocket client (browser vs not)
    or the server.

    On Mon, Oct 26, 2015 at 12:33 PM, Clayton Coleman [email protected]
    wrote:

    Suspect this is a hot read loop for zero byte reads in the websocket code.

    On Mon, Oct 26, 2015 at 12:30 PM, Jordan Liggitt <[email protected]

    wrote:

    Captured profile by starting with OPENSHIFT_PROFILE=web, and grabbing
    with go tool pprof http://localhost:6060/debug/pprof/profile when at
    250% CPU:

    [image: profile]
    https://cloud.githubusercontent.com/assets/980082/10735223/5cf77118-7bdd-11e5-889c-0727910bec5f.png

    —
    Reply to this email directly or view it on GitHub
    #5355 (comment).

  14. liggitt commented on Oct 26, 2015

    @liggitt
    Contributor

    For the record, CLI log streaming doesn't cause it (oc start-build ... --follow or oc build-logs ...)

  15. liggitt commented on Oct 26, 2015

    @liggitt
    Contributor

    Error being hotlooped:

    use of closed network connection
    read tcp4 10.13.129.51:55938: use of closed network connection
    use of closed network connection
    read tcp4 10.13.129.51:55938: use of closed network connection
    use of closed network connection
    use of closed network connection
    read tcp4 10.13.129.51:55938: use of closed network connection
    use of closed network connection
    use of closed network connection
    read tcp4 10.13.129.51:55938: use of closed network connection
    use of closed network connection
    read tcp4 10.13.129.51:55938: use of closed network connection
    use of closed network connection
    read tcp4 10.13.129.51:55938: use of closed network connection
    use of closed network connection
    read tcp4 10.13.129.51:55938: use of closed network connection
    use of closed network connection
    read tcp4 10.13.129.51:55938: use of closed network connection
    use of closed network connection
    read tcp4 10.13.129.51:55938: use of closed network connection
    use of closed network connection
    use of closed network connection
    read tcp4 10.13.129.51:55938: use of closed network connection
    use of closed network connection
    read tcp4 10.13.129.51:55938: use of closed network connection
    use of closed network connection
    read tcp4 10.13.129.51:55938: use of closed network connection
    use of closed network connection
    read tcp4 10.13.129.51:55938: use of closed network connection
    use of closed network connection
    
  16. liggitt commented on Oct 26, 2015

    @liggitt
    Contributor

    Guessing this is the issue, since wsstream.ignoreReceives appears in @mfojtik's goroutine dump at #5355 (comment)

  17. mfojtik commented on Oct 29, 2015

    @mfojtik
    ContributorAuthor

    @liggitt @smarterclayton this is not yet fixed in the OSE image @sdodson is building and pushing to the RCM registry

    @sdodson can you please rebuild/push image that will include the fix above?

    The version I pulled today is: openshift v3.0.2.903-29-g49953d6

  18. sdodson commented on Oct 29, 2015

    @sdodson
    Member

    Michal,

    I've rebuilt the image, please give it a shot. You should get
    openshift v3.0.2.903-114-g2849767

    On Thu, Oct 29, 2015 at 6:41 AM, Michal Fojtik [email protected]
    wrote:

    @liggitt https://github.com/liggitt @smarterclayton
    https://github.com/smarterclayton this is not yet fixed in the OSE
    image @sdodson https://github.com/sdodson is building in RCM registry

    —
    Reply to this email directly or view it on GitHub
    #5355 (comment).

  19. mfojtik commented on Oct 29, 2015

    @mfojtik
    ContributorAuthor

    @sdodson thanks, testing now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/performancekind/bugpriority/P1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions