Skip to content

Improve page load performance across the board.#2248

Merged
ketan merged 1 commit intogocd:masterfrom
ketan:fix-dashboard-perf
Jun 6, 2016
Merged

Improve page load performance across the board.#2248
ketan merged 1 commit intogocd:masterfrom
ketan:fix-dashboard-perf

Conversation

@ketan
Copy link
Member

@ketan ketan commented Jun 1, 2016

This PR solves 2 problems —

Problem 1

The ApplicationController#populate_health_messages filter was called
on every page load, and was re-computing all health state messages.
This computation had n^2 complexity for every health state message that
had to be rendered, this health state was rendered at the bottom of
every page inside go.

We now don't render the errors on page load, but rely on the ajax poll
to eventually render the errors in a few seconds after the page loads

Problem 2

To further reduce the cost of computation, we now pre-compute the health
state messages, and the pipelines that each server health state message
belongs to, via a background thread.

@ketan ketan force-pushed the fix-dashboard-perf branch from 1a5ef7f to 29d3af0 Compare June 1, 2016 12:49
public synchronized void onTimer(CruiseConfigProvider provider) {
CruiseConfig currentConfig = provider.getCurrentConfig();
getAllValidLogs(currentConfig);
LOG.info("Recomputing material to pipeline mappings.");
Copy link
Member

@arvindsv arvindsv Jun 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be INFO level or DEBUG? I guess it's ok because our default log level for the appender is WARN, but it doesn't seem like something a user or anyone should care about on a regular basis.

@arvindsv
Copy link
Member

arvindsv commented Jun 2, 2016

Looks good to me. Apart from what I mentioned in the comments above.

@ketan ketan force-pushed the fix-dashboard-perf branch 2 times, most recently from a55601e to 6173f03 Compare June 3, 2016 09:11
This PR solves 2 problems —

Problem 1
---------

The `ApplicationController#populate_health_messages` filter was called
on every page load, and was re-computing all health state messages.
This computation had n^2 complexity for every health state message that
had to be rendered, this health state was rendered at the bottom of
every page inside go.

We now don't render the errors on page load, but rely on the ajax poll
to eventually render the errors in a few seconds after the page loads

Problem 2
---------

To further reduce the cost of computation, we now pre-compute the health
state messages, and the pipelines that each server health state message
belongs to, via a background thread.
@ketan ketan force-pushed the fix-dashboard-perf branch from 6173f03 to ae12856 Compare June 3, 2016 14:10
@ketan ketan force-pushed the fix-dashboard-perf branch from 204044c to ae12856 Compare June 3, 2016 15:23
@ketan ketan added this to the Release 16.6 milestone Jun 6, 2016
@ketan ketan merged commit 91292b1 into gocd:master Jun 6, 2016
@ketan ketan removed the in progress label Jun 6, 2016
@ketan ketan deleted the fix-dashboard-perf branch June 6, 2016 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants