Page MenuHomePhabricator

Finding a performance bottleneck
Closed, ResolvedPublic

Assigned To
Authored By
Sergiidumyk
May 8 2020, 6:52 PM
Referenced Files
F31811350: B.png
May 10 2020, 5:18 PM
F31811349: A.png
May 10 2020, 5:18 PM
F31810933: Screen Shot 2020-05-10 at 12.25.37 PM.png
May 10 2020, 9:29 AM
F31809000: GTmetrix-001.fyi-20200509T003934-PhUEEI4H.har
May 9 2020, 7:49 AM
F31808294: Screen Shot 2020-05-08 at 9.43.53 PM.png
May 8 2020, 6:52 PM
F31808296: Screen Shot 2020-05-08 at 9.45.21 PM.png
May 8 2020, 6:52 PM
F31808291: Screen Shot 2020-05-08 at 9.41.51 PM.png
May 8 2020, 6:52 PM

Description

Hello! Looking at waterfall chart of my wiki loading it seems my server (Apache) is only serving 5 requests concurrently. I assume all requests after redirection to 'wiki/' could be processed concurrently.

Could this be related to some setting of ResourceLoader?

Screen Shot 2020-05-08 at 9.41.51 PM.png (1×2 px, 335 KB)

Screen Shot 2020-05-08 at 9.43.53 PM.png (340×496 px, 114 KB)

Screen Shot 2020-05-08 at 9.45.21 PM.png (226×2 px, 80 KB)

Event Timeline

Hi, can you share the urls of these load.php requests as well? I suspect I know what the issue is, but would like to be sure.

sure! the first 5:

  1. https://001.fyi/wiki/load.php?lang=en&modules=ext.inputBox.styles%7Cext.uls.pt%7Cext.visualEditor.desktopArticleTarget.noscript%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.skinning.interface%7Cmediawiki.ui.button%2Ccheckbox%2Cinput%7Cskins.vector.styles%7Cwikibase.client.init&only=styles&skin=vector
  2. https://001.fyi/wiki/load.php?lang=en&modules=ext.smw.style%7Cext.smw.tooltip.styles&only=styles&skin=vector
  3. https://001.fyi/wiki/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector
  4. https://001.fyi/wiki/load.php?lang=en&modules=site.styles&only=styles&skin=vector
  5. https://001.fyi/wiki/resources/assets/poweredby_mediawiki_88x31.png

The next group:

  1. https://001.fyi/wiki/load.php?lang=en&modules=ext.visualEditor.desktopArticleTarget.init%7Cext.visualEditor.progressBarWidget%2CsupportCheck%2CtargetLoader%2CtempWikitextEditorWidget%2Ctrack%2Cve&skin=vector&version=11sur
  2. https://001.fyi/wiki/load.php?lang=en&modules=ext.jquery.async%7Cext.libs.tippy%7Cext.smw%7Cext.smw.tooltips%7Csmw.tippy&skin=vector&version=1lu0f
  3. https://001.fyi/wiki/load.php?lang=en&modules=ext.inputBox%7Cext.uls.common%2Cinterface%2Cpreferences%2Cwebfonts%7Cjquery%2Csite%7Cjquery.client%2Ccookie%2CgetAttrs%2ChighlightText%2Cspinner%2Csuggestions%2CtabIndex%2CtextSelection%2Cthrottle-debounce%2Cui%7Cjquery.event.special.eachchange%7Cjquery.ui.core%2Cposition%2Csuggester%2Cwidget%7Cjquery.uls.data%7Cjquery.wikibase.entityselector%7Cmediawiki.String%2CTitle%2CUri%2Capi%2Cbase%2Ccldr%2Ccookie%2CjqueryMsg%2Clanguage%2Cnotify%2CsearchSuggest%2Cstorage%2Ctemplate%2Cuser%2Cutil%7Cmediawiki.editfont.styles%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.page.ready%2Cstartup%7Cmediawiki.template.regexp%7Cskins.vector.js%7Cuser.defaults%7Cutil.inherit%7Cwikibase.ui.entitysearch&skin=vector&version=kneuz

Final group:

  1. https://001.fyi/favicon.ico
  2. https://001.fyi/wiki/load.php?lang=en&modules=ext.uls.webfonts.fonts%2Crepository%7Cjquery.webfonts&skin=vector&version=17vll

Also the .har report

@Sergiidumyk Thanks. These are behaving as expected in that case. There is no problem with the server configuration of Apache or anything else.

Our documentation has a visual diagram that might be of use.

  1. The first group you see there are the resources needed for rendering the page (HTML and all CSS resources), as well as one async request for the "startup". These all load concurrently from each other.
    • The CSS requests should be given the highest priority.
    • If the user has visited another page on the wiki in the last 5 minutes, then this "startup" request will not happen. (It will be seen in the browser log, but only as a local "cache hit". Not a real request to the server).
    • If it has been more than 5 minutes since the last visit on the wikii, then the browser will make a tiny request with an If-None-Match header. If no MediaWiki upgrade or configuration change happened in the mean time, then the server will send an empty response (HTTP 304) telling the browser to use its cached version and go ahead with that.
  1. The page is rendered and ready, and we have the "startup" module (from the local cache, or fresh from the server). The startup module will expand the list of modules from the current page meta data and load each of them concurrently. Modules that you have downloaded before on another page will come directly from the localStorage cache without any request showing in the Network panel. Modules that are new or have changed, will come from the server instead.

This is normally where it ends. However in your case there is also ULS installed, which waits for the page to load and then manually loads some additional data in the background. ("Lazy load"). This uses mw.loader within JavaScript to load additional modules. That is why there is also a group three.

Thank you for this great clarification! I was just wondering, from comparing with how en.wikipedia.com loads up, since there it looks more like pretty much everything, after initial redirects, loads concurrently. I mean still I see some groups, but they don't wait for each other.

Screen Shot 2020-05-10 at 12.25.37 PM.png (1×3 px, 529 KB)

Krinkle claimed this task.

They do wait for each other.

  • CSS images are disocovered as needed by the browser based on it receiving the HTML for the current page and the CSS file. The images cannot load sooner.
  • The article images are discovered from the article HTML. The images cannot load sooner.
  • The page modules are loaded (if needed, and not cached) once the startup registry is available. They cannot load sooner.

On the Wikipedia article, there are more of these chains overlapping each other so there is less "idle" time waiting for the next step. On your test page there is less going on, so the only chain you see (JS) is more visible.

A.png (1×2 px, 298 KB)

B.png (1×3 px, 479 KB)