Page MenuHomePhabricator

FY2022-2023: Improve Backend Pageview Timing
Open, Needs TriagePublic

Description

Tracking task for various improvements releating to improving general backend response times for pageview rendering.

Motivation

Data

https://grafana.wikimedia.org/d/QLtC93rMz/backend-pageview-timing

Revisions and Commits

Related Objects

StatusSubtypeAssignedTask
Openpmiazga
ResolvedLadsgroup
ResolvedLadsgroup
ResolvedKrinkle
ResolvedNone
ResolvedNone
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
ResolvedJdforrester-WMF
ResolvedPRODUCTION ERRORUmherirrender
Resolveddaniel
Resolveddaniel
Resolveddaniel
ResolvedPeter.ovchyn
Resolveddaniel
ResolvedKrinkle
ResolvedLadsgroup
ResolvedKrinkle
ResolvedKrinkle
ResolvedKrinkle
OpenNone
ResolvedKrinkle
OpenNone
DeclinedNone
Resolvedfgiunchedi
Resolvedtstarling
Resolvedaaron
OpenNone
OpenNone
OpenNone
ResolvedLegoktm
ResolvedCatrope
ResolvedLegoktm
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedLadsgroup
OpenNone
ResolvedKrinkle
DuplicateNone
OpenNone
ResolvedLadsgroup
DuplicateKrinkle
Resolvedmatmarex
ResolvedPRODUCTION ERRORmatmarex
ResolvedPRODUCTION ERRORKrinkle
ResolvedNone
ResolvedPRODUCTION ERRORFunc
ResolvedYaron_Koren
ResolvedMarostegui
ResolvedLadsgroup
ResolvedKrinkle
ResolvedMainframe98
Resolvedaaron
OpenNone
ResolvedTK-999
OpenNone
OpenNone
OpenNone
Resolvedpmiazga
ResolvedNone
Resolvedpmiazga
OpenNone
OpenNone

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 766179 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] HomepageHooks: Micro-optim around onMessageCache__get() and other hooks

https://gerrit.wikimedia.org/r/766179

Change 822495 had a related patch set uploaded (by Krinkle; author: Tim Starling):

[mediawiki/core@master] SessionManager: don't check whether newly generated session IDs already exist

https://gerrit.wikimedia.org/r/822495

Change 822495 merged by jenkins-bot:

[mediawiki/core@master] SessionManager: don't check whether newly generated session IDs already exist

https://gerrit.wikimedia.org/r/822495

Change 830706 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] [DNM] objectcache: Disable cool-off bounce feature

https://gerrit.wikimedia.org/r/830706

Change 838872 had a related patch set uploaded (by Krinkle; author: Aaron Schulz):

[mediawiki/core@master] objectcache: use WRITE_BACKGROUND in WANObjectCache where applicable

https://gerrit.wikimedia.org/r/838872

Change 838872 merged by jenkins-bot:

[mediawiki/core@master] objectcache: use WRITE_BACKGROUND in WANObjectCache where applicable

https://gerrit.wikimedia.org/r/838872

Change 838872 merged by jenkins-bot:

[mediawiki/core@master] objectcache: use WRITE_BACKGROUND in WANObjectCache where applicable

https://gerrit.wikimedia.org/r/838872

Impact on https://grafana.wikimedia.org/d/lqE4lcGWz/wanobjectcache-key-group, as measured by the most trafficked key group (SqlBlobStore_blob):

Screenshot 2022-11-18 at 00.42.24.png (611×1 px, 136 KB)

Screenshot 2022-11-18 at 00.42.42.png (1×1 px, 278 KB)

The total miss-compute time is all time spent in getWithSet during a cache miss. The regen_set_delay is the time up until right before the SET command (and possibly the cool-off bounce). This time has been cut by 0.5ms from 0.75ms to 0.25ms.

Would T124371: Clean up usage of $_SESSION in WMF-deployed extensions be worth looking into? I think PHPSessionHandler triggers lots of unnecessary session logic by registering SessionManager as a PHP session handler, which is only necessary for compatibility with old code which does normal PHP session operations, which is hopefully all gone by now, so we should be able to switch off $wgPHPSessionHandling in Wikimedia production, and maybe as a MediaWiki default.

Would T124371 be worth looking into? I think PHPSessionHandler triggers lots of unnecessary session logic […]

If I understand correctly, wgPHPSessionHandling only controls compat code for $_SESSION. Turning it off is not the same as enabling MW_NO_SESSION, correct? (Although enabling MW_NO_SESSION does -also- disable wgPHPSessionHandling of course.)

I'd agree. We could as a first step set it to "warn" in beta and on test wikis. Then once WMF has reached the "disable" stage on all wikis, we can e.g. set it to "warn" for one MW LTS cycle.

If I understand correctly, wgPHPSessionHandling only controls compat code for $_SESSION. Turning it off is not the same as enabling MW_NO_SESSION, correct?

Correct. When it is $wgPHPSessionHandling is enabled, SessionManager is registered as the PHP session handler. In theory, this is entirely unnecessary for SessionManager to work; it's only needed to avoid a split-brain situation when some code invokes PHP session handling directly (by touching $_SESSION, calling session_start() etc). I'm not at all sure but I think it results in a bunch of extra calls to SessionManager even if nothing directly invokes PHP session handling, just because the interface for PHP session handlers is limited and awkward.

Change 890872 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] linker: Remove DB lookups from makeKnownLink() and improve docs

https://gerrit.wikimedia.org/r/890872

Change 902376 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@wmf/1.41.0-wmf.1] objectcache: Disable cool-off bounce feature

https://gerrit.wikimedia.org/r/902376

Change 830706 merged by jenkins-bot:

[mediawiki/core@master] objectcache: Remove WANObjectCache's internal cool-off bounce feature

https://gerrit.wikimedia.org/r/830706

Ladsgroup closed subtask Restricted Task as Resolved.Dec 10 2023, 1:17 PM