Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High CPU Usage in Dashboards #2281

Closed
STRML opened this issue May 24, 2016 · 3 comments
Closed

High CPU Usage in Dashboards #2281

STRML opened this issue May 24, 2016 · 3 comments

Comments

@STRML
Copy link

@STRML STRML commented May 24, 2016

Problem description

CPU Usage in Chrome is roughly 60-80% while idle with just a few chart widgets.

Steps to reproduce the problem

  1. Add a few chart widgets with many datapoints to a dashboard.
  2. Profile.

Environment

  • Graylog Version: 2.0.1 (81e0187)
  • Operating System: OS X 10.11.4
  • Browser version: Chrome 50.0.2661.102

Profiles

The following profile was taken shortly after loading. The pattern from 5s onward continues into perpetuity.

screen shot 2016-05-24 at 3 46 51 pm
screen shot 2016-05-24 at 3 47 19 pm

CPU-20160524T154645.cpuprofile.zip

@STRML
Copy link
Author

@STRML STRML commented May 24, 2016

The majority of the usage is a result of the render of https://github.com/Graylog2/graylog2-server/blob/master/graylog2-web-interface/src/components/visualizations/StackedGraphVisualization.jsx, which does not compare props with prevProps. We could probably get a decent boost with shouldComponentUpdate, a bit more by checking deep equality of the last dataPoints before rendering, and perhaps more by appending only the new bars.

I'm not particularly familiar with c3/d3 in react, but I do see a large number of wrapper components. Perhaps they could do some of that work for us?

@dennisoelkers dennisoelkers self-assigned this May 25, 2016
@kroepke kroepke added this to the 2.1.0 milestone May 30, 2016
@bernd
Copy link
Member

@bernd bernd commented Aug 3, 2016

@STRML Thank you very much for the detailed information! I will move this to the 2.2.0 milestone, we weren't able to work on this for 2.1 unfortunately.

@bernd bernd modified the milestones: 2.1.0, 2.2.0 Aug 3, 2016
@edmundoa edmundoa assigned edmundoa and unassigned dennisoelkers Aug 3, 2016
@edmundoa edmundoa modified the milestones: 2.1.0, 2.2.0 Aug 3, 2016
@edmundoa
Copy link
Member

@edmundoa edmundoa commented Aug 3, 2016

Actually, let's move it back into 2.1.0. I have found a couple of issues with the update that can at least mitigate the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants