Page MenuHomePhabricator

[INVESTIGATION] Evaluate speed of key interactions on Wikibase.dev
Closed, ResolvedPublic

Description

As a user of Wikibase.cloud, I want my wikis to be responsive so that my everyday editing or reading tasks can be completed smoothly and successfully.

Currently, we are encountering certain "slow" interactions on Wikibase.dev (and therefore Wikibase.cloud). Users of WBstack.com have also noted that certain areas of that service could benefit from speed improvements.

To ensure that Wikibase.cloud is adequately performant on initial launch, we should investigate the following while logged into the wiki as a user:

InteractionCurrent SpeedWikidata SpeedTarget SpeedNotes
Load the main page of the wiki16831126
Type a QID or item label into search and be suggested a match687494
Load an entity page (e.g. Q1) containing statements1225853please also note if there is a delay between page content loading and when the edit icon appears next to a statement
Open the add statement console by clicking +add statement94117
Save a statement3648602
New item page is displayed after clicking Create on Special:NewItem84581316
Results of a simple query are displayed in the Query Service2725
Results of a complex query are displayed in the Query ServiceN/A

The outcome of this initial investigation will be that the above table is completed with [something like] the average of 3 speed measurements of each interaction (current speed column). Target speed may be defined in collaboration with the UX team. This investigation help to inform a subsequent investigation and/or task focused on improving the speed of Wikibase.cloud.

N.B: for these measurements it's sufficient to use the "developer tools" of your browser.

Event Timeline

Tarrow moved this task from Backlog (incoming) to Ready to Pick Up on the Wikibase Cloud board.
Tarrow subscribed.

Moving straight to ready to pick up because this task doesn't require breakdown. It's just collecting some data.

Current Time for action (ms)
123AVG
Load the main page of the wiki (time to fire on load event)1814155216841683.333333
Type a QID or item label into search and be suggested a match (time between from text string visible to result visible)830740490686.6666667
Load an entity page (e.g. Q1) containing statements (time to fire onload event)1135.5124012991224.833333
Open the add statement console by clicking +add statement (using "frame"1008310094.33333333
Save a statement (click save - formatted statement and edit button appearing)4384376128003648.333333
New item page is displayed after clicking Create on Special:NewItem7707860090678458
Results of a simple query are displayed in the Query Service (select all statements from "play button colour change")3362242223922725.333333

I decided that "a complex query" was probably too vague and therefore didn't investigate trying to orchestrate something like this.

All results determined using google chrome performance tools tab of developer tools. On https://coffeebase.wikibase.dev/

Addshore subscribed.

So, trying to reproduce the above.

For the page load timings:

  • Turn off caching
  • Use this button
    image.png (76×135 px, 3 KB)

I get similar numbers:

Current Time for action (ms)
123AVG
Load the main page of the wiki (time to fire on load event)12961527

So it looks like this would be repeatable.

Not sure how much value there is in the Open the add statement console by clicking +add statement (using "frame" metric.

In the long run we might be better off enabling metric collection from MediaWiki (including Wikibase) etc.

We may also want to dig into why New item page is displayed after clicking Create on Special:NewItem is so slow!

Deniz_WMDE moved this task from Done to Review on the Wikibase Cloud board.

I've been having a chat with @Jan_Dittrich. It is worth us certainly comparing these metrics to similar ones from wikidata.org. Firstly because if wikidata.org has optimised to this level then maybe we can copy the method. Secondly most of our users come with some familiarity with wikidata so we wouldn't want to be "worse" than it.

Generally we should strive for each action to be less than one (1) second in the short term. In the long term we should keep in mind that 1/10 of this (100ms) is closer to what a user would experience as "immediate".

Tarrow moved this task from Review to Doing on the Wikibase Cloud board.

Here some background on what we talked about:

As general heuristics there are the thresholds of

<0.1s= immediate reaction
<1s= "in control", no "waiting" feeling
>1s= feels slow, waiting
>10s= what is going on? Lets do something else.

This is based upon this article: https://www.nngroup.com/articles/response-times-3-important-limits/

So what can be done if one is below the threshold needed?

  1. Speed the system up to get under the threshold but if that leads to diminishing returns…
  2. Show a stand-in system reaction. You know these: Boxes instead of content, waiting indicators. Just take care that it does not lead to screen flicker all over the place when the "real" content is there (e.g. fade in)

For Wikibase, it probably matters that:

  • New pages appear within a second (not necessarily with all interaction) so people experience that they navigate seamlessly.
  • There should be a reaction to clicks, input fields etc. within 0.1s
  • Larger tasks that can’t be reduced below or near to 1s should have some stand-in to show that the system is reacting.

For wikibase cloud we need to consider that the distribution of frequency/impact is probably different than on Wikidata since people probably do more writing and less reading operations when experimenting with the system.

Similar work done for Wikidata (and test.wikidata.org). Simple query skipped since it would return faaar more results there than on wikibase.dev

Current Time for action wikidata (ms)(test.wikidata.org for new item creation)
123AVG
Load the main page of the wiki (time to fire on load event)943103214031126
Type a QID or item label into search and be suggested a match (time between from text string visible to result visible)560380543494.3333333
Load an entity page (e.g. Q1/Q4115189) containing statements (time to fire onload event)812915833853.3333333
Open the add statement console by clicking +add statement (using "frame"85146120117
Save a statement (click save - formatted statement and edit button appearing)700491615602
New item page is displayed after clicking Create on Special:NewItem1481120812601316.333333

@Addshore and I talked about what caching we might implement. For both the MainCache
A very casual switch to use redis for caching on my local development environment resulted in no noticeable speed up

Tarrow moved this task from Doing to Done on the Wikibase Cloud (Launch Sprint 1 (2022)) board.

Finally I saw a ~2x speed improvement (but un-impacted by the absence or presence of redis caching) by increasing the resources allocated to pods on my local minikube cluster.

MediaWiki

resources:
   web:
     requests:
-      cpu: 150m
-      memory: 350Mi
+      cpu: 2
+      memory: 2000Mi
     limits:
-      cpu: 400m
-      memory: 750Mi
+      cpu: 2
+      memory: 2000Mi
   webapi:
     requests:
-      cpu: 200m
-      memory: 250Mi
+      cpu: 2
+      memory: 2000Mi
     limits:
-      cpu: 500m
-      memory: 600Mi
+      cpu: 2
+      memory: 2000Mi

SQL primary:

resources:
     requests:
-      cpu: 40m
-      memory: 700Mi
+      cpu: 2
+      memory: 2000Mi
     limits:
-      cpu: 750m
-      memory: 1000Mi
+      cpu: 2
+      memory: 2000Mi

I saw a similar but slightly slower increase with less excessive resource allocation.

This ticket is probably now "done". We'll have a follow-up with actual targets to hit if @Samantha_Alipio_WMDE thinks that we need to speed up now.