vmware-archive / octant

Highly extensible platform for developers to better understand the complexity of Kubernetes clusters.
https://octant.dev
Apache License 2.0
6.28k stars 483 forks source link

Excessive energy and memory utilization by browser component #2072

Open ReggieCarey opened 3 years ago

ReggieCarey commented 3 years ago

What steps did you take and what happened: [A clear and concise description of what the bug is, and what commands you ran.)

Launch octant in a terminal window on macOS

Eventually - not sure what causes it: Safari browser on macOS (Catalina and BigSur) reports "This webpage is using significant energy. Closing it may improve the responsiveness of your Mac."

What did you expect to happen:

I do not expect excessive resource utilization from the browser component or the server.

Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]

octant process consumes significant CPU (200+% or more) when a browser is attached. octant process consumes little CPU (1%) when no browser is attached. Tried both Safari and Google Chrome - both cause the same problems with octant process. Each new attached browser increases CPU utilization in octant process. Octant terminal window shows no faults.

Examining memory utilization, Octant browser page (Safari) regularly consumes Gigabytes of ram. Fine if there is caching but there does not appear to be based on performance.

The excessive CPU utilization of the Octant server code seems to be related to the excessive energy utilization of the browser code. I just killed the browser and Octant server utilization dropped from 200+% of CPU to ~1.5%. Restarting the browser causes cpu utilization to spike up to 100% and higher.

I've confirmed that this is related to the app running in the browser. I have 3 browser windows open to octant (127.0.0.1:7777) and CPU utilization is now at 450% just sitting idle.

TEST: restart octant process - browser launched - octant process CPU = 112% idle wake ups = ~4500/second launch second page to octant process. octant process CPU = 200% - 350% idle wake ups = ~9000/second launch third page to octant process. octant process CPU = 200% - 350% idle wake ups = ~9000/second

kill all browser windows

octant process CPU = 1-2%. idle wake ups = ~300/second

In all of the above experiments, there was NO interaction with the browser based user interface.

Eventually the browser page starts to consume significant resources (RAM/CPU) and Safari puts out its warning.

Environment:

wwitzel3 commented 3 years ago

related #2013

wwitzel3 commented 3 years ago

We can do some investigation of this further using something like https://github.com/pyroscope-io/pyroscope