Page MenuHomePhabricator

Expose PHP7/HHVM to NavTiming in a header, send with navtiming beacon so we can use it as a dimension
Closed, ResolvedPublic

Description

@Gilles @Krinkle Based on the work that you've been doing with NavTiming over the last few months, is this something that would be easy to do? (Either add a header to the response that specifies whether the page in question was served by PHP7/HHVM, or reading the cookie that we'll be setting on the client side to direct people to the A/B group.)

Event Timeline

Imarlier triaged this task as Normal priority.Dec 13 2018, 5:58 PM
Imarlier created this task.
Restricted Application removed a project: Patch-For-Review. · View Herald TranscriptDec 13 2018, 5:58 PM

If there's already a cookie planned to enable that, I think that's the easiest thing to use here. Server-Timing has limited cross-browser support at this point: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing

bd808 added a comment.Dec 13 2018, 9:44 PM

During the HHVM rollout, mw.config.get( 'wgPoweredByHHVM' ) would tell you if the page was being rendered via HHVM or not: rEWMV973c7340e75f: Inject 'wgPoweredByHHVM' JS config var if powered by HHVM

Joe added a comment.Dec 14 2018, 9:07 AM

The application server layer https://gerrit.wikimedia.org/r/plugins/gitiles/operations/puppet/+/production/modules/mediawiki/templates/apache/mediawiki-vhost.conf.erb#14, and the caching layer https://gerrit.wikimedia.org/r/c/operations/puppet/+/478680/6/modules/varnish/templates/text-frontend.inc.vcl.erb are set to recognize the cookie PHP_ENGINE and send traffic to php-fpm if the value is php7.

Responses from php and hhvm can be told apart from their X-Powered-By header too.

I think we can do the same thing that was done back in the day - expose the rendering engine as a config value that can be used directly in javascript.

Imarlier claimed this task.Dec 17 2018, 9:15 PM
Imarlier moved this task from Inbox to Backlog: Small & Maintenance on the Performance-Team board.
greg removed a subscriber: greg.Dec 18 2018, 1:16 AM
kchapman removed Imarlier as the assignee of this task.Jan 25 2019, 1:49 AM
kchapman moved this task from Backlog: Small & Maintenance to Inbox on the Performance-Team board.
GTirloni removed a subscriber: GTirloni.Mar 21 2019, 9:06 PM
Gilles claimed this task.Jun 6 2019, 10:28 AM
Gilles raised the priority of this task from Normal to High.
Gilles moved this task from Backlog: Small & Maintenance to Doing on the Performance-Team board.

Change 516470 had a related patch set uploaded (by Gilles; owner: Gilles):
[mediawiki/extensions/NavigationTiming@master] Record PHP engine used to render the page

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

Change 516470 merged by jenkins-bot:
[mediawiki/extensions/NavigationTiming@master] Record PHP engine used to render the page

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

Gilles closed this task as Resolved.Jun 19 2019, 2:09 PM

It's now being recorded:

SELECT event.phpEngine, COUNT(*) FROM event.navigationtiming WHERE year = 2019 AND month = 6 AND day = 19 GROUP BY event.phpEngine;

phpengine	_c1
NULL	247326
hhvm	120138
zend	18766

Change 517866 had a related patch set uploaded (by Gilles; owner: Gilles):
[analytics/refinery@master] Retain new phpEngine field in NavigationTiming

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

Change 517866 merged by Nuria:
[analytics/refinery@master] Retain new phpEngine field in NavigationTiming

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