Kibana: 7.7.0 general performance problems, blocking IE11

Created on 1 Apr 2020  路  13Comments  路  Source: elastic/kibana

Kibana version: 7.7.0-snapshot

Elasticsearch version: 7.7.0-snapshot

Server OS version: Windows 10

Browser version: IE11

Browser OS version: Windows 10

Original install method (e.g. download page, yum, from source, etc.): default dist zips

Describe the bug: Changes from 7.6 to 7.7.0 (new platform build?) have caused generally worse performance for Kibana loading and switching between apps in any browser. And it's significant enough to cause IE11 to either not load some apps (such as Canvas) or to frequently quit and reload Kibana.

Steps to reproduce:

  1. run Kibana 7.7.0 in IE11, compare to 7.6.2
    2.
    3.

Expected behavior: Even though we add features to Kibana we should also try to improve performance.

Screenshots (if relevant):

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):

Any additional context:

This is very likely to impact Cloud deployments, and Reporting. But not confirmed yet.

Operations blocker bug regression v7.7.0

Most helpful comment

I think this is complete now that we've made so many small adjustments to make the bundle smaller, and remove specifically large items from the build. Thanks everyone for the help, but especially @restrry @tylersmalley @mistic @joshdover and @pgayvallet

Tyler is still going to look into tree-shaking, but I don't think there's any way we'll get it in during feature freeze. And Tiago might find the reason SIEM/APM bundles have grown so big, but we probably don't need to risk 7.7 any more with more changes here as IE is pretty darn usable as is.

All 13 comments

Pinging @elastic/kibana-operations (Team:Operations)

A couple of statistics about the change from the latest 7.6.2 to this 7.7.0 default distribution Windows zip files;
| Version | zip file size | File count |
|---------|--------------|------------|
| 7.6.2 | 291MB | 99,003 |
| 7.7.0 | 367MB | 163,977 |

A lot of the bundle names don't match up between releases. But here's some data on the ones that do;

| Bundle | 7.6.2 size | 7.7.0 size | % change |
|--------|------------|------------|----------|
canvas.bundle.js | 12152030 | 12265199 | 0.9%
commons.bundle.js | 7629678 | 8379439 | 9.8%
apm.bundle.js | 730165 | 2379977 | 226.0%
kibana.bundle.js | 5318708 | 2168995 | -59.2%
monitoring.bundle.js | 951781 | 1023270 | 7.5%
uptime.bundle.js | 372167 | 512140 | 37.6%
siem.bundle.js | 199334 | 423438 | 112.4%
timelion.bundle.js | 96378 | 97078 | 0.7%
maps.bundle.js | 35120 | 37552 | 6.9%
status_page.bundle.js | 32406 | 33800 | 4.3%
dashboardViewer.bundle.js | 10300 | 10149 | -1.5%
lens.bundle.js | 8888 | 8812 | -0.9%
core.bundle.js | 8389 | 8311 | -0.9%
dark_theme.bundle.js | 2166 | 2058 | -5.0%
light_theme.bundle.js | 2167 | 2058 | -5.0%

Expected behavior: Even though we add features to Kibana we should also try to improve performance.

This was a trade off that we decided to take because we really need to get rid of the optimizer in production, and our design to accomplish this included some code duplication that we were expecting. We expected that this might cause initial page load times to be slower, but it also meant that the assets would be more stable, Kibana would be more reliable, run with less memory required server side, and most importantly, be able to remove the loading indicator between apps. In order to get there we needed to increase the side of each bundle.

What we didn't know, or expect, was that the size of the bundles would grow so large that IE would stop working.

This has surprised us and lead to us pulling some emergency levers to reduce the overall size of the code (#62364) and a few that will reduce the size of the code initially loaded on a page (#62344, #62363, #62403, #62408, #62434, #62487, #62493).

I'm also working on reporting improvements so that in the 7.8 timeframe we will be able to analyze how big bundles are, and how changes we are making impacts the size of those bundles. Shortly after that's done we want to tie that into the reporting done on PRs so that PR authors will be confronted with the impact their PR has on the bundle sizes early and we won't be surprised by this down the road.

What we didn't know, or expect, was that the size of the bundles would grow so large that IE would stop working.

Right now we focus on an assumption that memory usage is the bottleneck for IE.
In theory, we might have another problem that could affect IE is a page load time. In v7.7 Kibana performs ~120 requests to load client-side assets, which might cause timeout error. If all our current improvements don't help much, we will switch to https://github.com/elastic/kibana/issues/55241 to improve load time.

As long as IE11 is a targeted browser, shouldn't we have a few windows CI nodes with IE11 to at least run some smoke tests on that environment? It seems like we currently have no way to have any idea of the performances / issues of running kibana on that specific browser, which cause the actual issues to be detected extremely late in our testing process, if not by end user themselves.

Action items from this mornings sync:

  • [x] Continue to add async loaders to largest contributors (@restrry )
  • [x] Temporarily add data plugin to shared-deps https://github.com/elastic/kibana/pull/62720 (@spalger)
  • [x] Investigate major increase in legacy bundle size for APM/SIEM (@mistic)
  • [ ] Enable tree shaking for new platform plugins https://github.com/elastic/kibana/pull/62390 (@tylersmalley)
  • [x] Generate full report for difference between 7.7.0 BC4 and 7.6.2 (@tylersmalley)

I am tracking the changes of Javascript assets which are loaded when accessing the home page:

https://docs.google.com/spreadsheets/d/16mB-yZAHoMBYgExXC5gdSjNVROrNCs0z6Dt7MEd8ilA/edit#gid=0

My quest to dedupe a lot of code by sharing the data plugin and a few others has led to many problems, and we're still unable to use IE reliably with the changes in place, so I'm going to start looking into reverting the new platform build system from 7.7. This change would go directly into 7.7 and not master, and would hopefully not cause many (if any) changes outside of the operations specific code, but will continue building everything in the legacy optimizer for now. This might not work, but it's feeling more and more like an option we need to take more seriously.

On the latest 7.7.0 snapshot from today COMMIT 797be9e5 on IE11. I tried to click through everything but didn't have APM data, SIEM data, etc. This is just a list of things I couldn't get to work. Once I hit one of these features and it causes a problem I generally have to close the IE11 browser and re-open it.

  • Canvas won't open
  • Dev Tools > Console - the default query shows a 200 response code but doesn't show anything in the results pane
  • Logs app and Metrics app both showed -

Error
TypeError: Object doesn't support this action
   at history[method] (https://localhost:5601/built_assets/dlls/vendors_1.bundle.dll.js:124:13986)
   at history[method] (https://localhost:5601/bundles/plugin/infra/5.plugin.js:1:40845)
   at Anonymous function (https://localhost:5601/bundles/plugin/infra/infra.plugin.js:6:159558)
   at confirmTransitionTo (https://localhost:5601/bundles/plugin/infra/infra.plugin.js:6:154758)
   at replace (https://localhost:5601/bundles/plugin/infra/infra.plugin.js:6:159366)
   at onMount (https://localhost:5601/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:271:487154)
   at n.componentDidMount (https://localhost:5601/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:271:485966)
   at vl (https://localhost:5601/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:342:100771)
   at t.unstable_runWithPriority (https://localhost:5601/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:350:3455)
   at Hi (https://localhost:5601/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:342:45427)


797be9e55f7098a110059fd9e7a9f7e14a01f259 is from two days ago and does not include the PR merged yesterday by Spencer.

Can you test with the most recent CI run on the 7.7 branch? You can get the tar.gz from the Google Cloud Storage Upload Report:

kibana-7.7.0-SNAPSHOT-linux-x86_64.tar.gz

I actually did test builds that @spalger provided and they looked much better. Canvas caused IE11 to restart once, but then loaded. And all the other things I knew were broke in IE11 worked. But I'll pull those latest ones and give another go.

But, if you have confidence and good code reviews, please don't wait on my testing to merge your fixes. I can already tell from Spalger's builds it's much better than before and we need other UI teams to be able to run their tests on either a snapshot build or new BC.

I think this is complete now that we've made so many small adjustments to make the bundle smaller, and remove specifically large items from the build. Thanks everyone for the help, but especially @restrry @tylersmalley @mistic @joshdover and @pgayvallet

Tyler is still going to look into tree-shaking, but I don't think there's any way we'll get it in during feature freeze. And Tiago might find the reason SIEM/APM bundles have grown so big, but we probably don't need to risk 7.7 any more with more changes here as IE is pretty darn usable as is.

I also want to mention that we have 2 merged prs (not backported into 7.7) that have reduced the apm and the siem bundles size https://github.com/elastic/kibana/pull/63269 and https://github.com/elastic/kibana/pull/63292

Was this page helpful?
0 / 5 - 0 ratings