<div dir="ltr"><div>Hello,</div><div><br></div><div>Here's what the performance team has been up to.</div><div><br></div><div>== Dashboards & instrumentation ==</div><div>We spent time instrumenting software and curating displays of performance data. We have several new dashboards to share with you:</div><div><br></div><div>* Global edit rate and save failures (new)</div><div>  <a href="https://grafana.wikimedia.org/dashboard/db/edit-count">https://grafana.wikimedia.org/dashboard/db/edit-count</a></div><div><br></div><div>* Performance metrics (revamped)</div><div>  <a href="https://grafana-admin.wikimedia.org/dashboard/db/performance-metrics">https://grafana-admin.wikimedia.org/dashboard/db/performance-metrics</a></div><div><br></div><div>* Page load performance</div><div>  <a href="https://grafana.wikimedia.org/dashboard/db/navigation-timing">https://grafana.wikimedia.org/dashboard/db/navigation-timing</a></div><div><br></div><div>  ...by continent: <a href="https://grafana.wikimedia.org/dashboard/db/navigation-timing-by-continent">https://grafana.wikimedia.org/dashboard/db/navigation-timing-by-continent</a></div><div>  ...by country  : <a href="https://grafana.wikimedia.org/dashboard/db/navigation-timing-by-geolocation">https://grafana.wikimedia.org/dashboard/db/navigation-timing-by-geolocation</a></div><div>  ...by browser  : <a href="https://grafana.wikimedia.org/dashboard/db/navigation-timing-by-browser">https://grafana.wikimedia.org/dashboard/db/navigation-timing-by-browser</a></div><div><br></div><div>* We found that certain browsers were reporting wildly inaccurate timing data and skewing our summary performance metrics, and reacted by validating browser metric data more strictly against Navigation Timing API specs.</div><div><br></div><div><br></div><div>== ResourceLoader ==</div><div>ResourceLoader is the MediaWiki subsystem responsible for loading CSS, JavaScript, and i18n interface messages for dynamic site features. It is critical to site performance. Changes to ResourceLoader are focused on reducing backend response time, ensuring we make efficient use of the browser cache, and reducing time to first paint (the time it takes any content to appear). This work is led by Timo Tijhof.</div><div><br></div><div>* The "/static/$mwBranch" entry point has been deprecated and removed in favor of wmfstatic - a new multiversion-powered entrypoint accessed via "/w" (via RewriteRule)</div><div>  <a href="https://phabricator.wikimedia.org/T99096">https://phabricator.wikimedia.org/T99096</a></div><div><br></div><div>* Restricting addModuleStyles() to style-only modules (ongoing)</div><div>  <a href="https://phabricator.wikimedia.org/T92459">https://phabricator.wikimedia.org/T92459</a></div><div><br></div><div>* Startup module check is now based on a feature test instead of browser blacklist</div><div>  <a href="https://phabricator.wikimedia.org/T102318">https://phabricator.wikimedia.org/T102318</a></div><div><br></div><div><br></div><div>== WebPageTest ==</div><div>Page load performance varies by browser, platform, and network. To anticipate how code changes will impact page performance for readers and editors, we use WebPageTest (<a href="https://wikitech.wikimedia.org/wiki/WebPageTest">https://wikitech.wikimedia.org/wiki/WebPageTest</a>), a web performance browser automation tool. WebPageTest loads pages on Wikimedia wikis using real browsers and collects timing metrics. This work is led by Peter Hedenskog.</div><div><br></div><div>* We now generate waterfall charts for page loads on Firefox. Previously we were only able to produce them with Chrome.</div><div><br></div><div>* We tracked downs two bugs in WebPageTest that caused it to report an incorrect value for time-to-first-byte and reported them upstream.</div><div>  <a href="https://phabricator.wikimedia.org/T130182">https://phabricator.wikimedia.org/T130182</a></div><div>  <a href="https://phabricator.wikimedia.org/T129735">https://phabricator.wikimedia.org/T129735</a> </div><div><br></div><div>* We upgraded the WebPageTest agent instance after observing variability in measurements when the agent is under load.<br></div><div>  <a href="https://phabricator.wikimedia.org/T135985">https://phabricator.wikimedia.org/T135985</a></div><div><br></div><div>* We designed a new dashboard to help us spot performance regressions</div><div>  <a href="https://grafana.wikimedia.org/dashboard/db/webpagetest">https://grafana.wikimedia.org/dashboard/db/webpagetest</a> </div><div><br></div><div><br></div><div>== Databases ==</div><div>The major effort in backend performance has been to reduce replication lag. Replication lag occurs when a slave database is not able to reflect changes on the master database quickly enough and falls behind. Aaron Schulz set out to bring peak replication lag down from ten seconds to below five, by identifying problematic query patterns and rewriting them to be more efficient. We are very close to hitting that target: replication lag is almost entirely below five seconds on all clusters.</div><div><br></div><div><a href="https://phabricator.wikimedia.org/T95501">https://phabricator.wikimedia.org/T95501</a></div><div><br></div><div>* High lag on databases used to generate special pages no longer stops job queue processing</div><div>  <a href="https://phabricator.wikimedia.org/T135809">https://phabricator.wikimedia.org/T135809</a></div><div><br></div><div>== Multi-DC ==</div><div>"Multi-DC" refers to ongoing work to make it possible to serve reads from a secondary data center. Having MediaWiki running and serving requests in more than one data center will reduce latency and improve site reliability. This project is led by Aaron Schulz.</div><div><br></div><div>In order for this to be possible, we need to be able to anticipate which requests will need the master database, so we can route them accordingly. The plan is to achieve this by making sure that GET requests never require a master database connection. We've made progress incremental progress here, most recently by changing action=rollback to use JavaScript to perform HTTP POST requests.</div><div><br></div><div>We also need to be able to broadcast cache purges across data centers. The major work on this front has been the addition to core of EventBus classes that relay cache proxy and object cache purges. Stas Malyshev of the discovery team is assisting with this work.</div><div><br></div><div>== Thumbor ==</div><div>"Thumbor" is shorthand for the project to factor thumbnail rendering out of MediaWiki and into a standalone service based on Thumbor (<a href="http://thumbor.org/">http://thumbor.org/</a>). This project is led by Gilles Dubuc. The following list summarizes recent progress:</div><div><br></div><div>- Simplified the VCL as much as possible</div><div>- Added client throttling with the tbf vmod</div><div>- Added progressive JPEG support to ImageMagick engine</div><div>- Added configurable chroma subsampling support</div><div>- Made SVG detection more robust</div><div>- Added multilanguage SVG support</div><div>- Reproduced temp folder security mechanism found in MediaWiki for SVG for all file types</div><div>- Swift's rewrite.py ported to vagrant. On Vagrant thumbor now hooks itself into the same point in the stack it will in production</div><div>- Swift storage implemented (shard support left to do)</div><div>- Matched Content-Disposition behavior to MediaWiki</div><div>- Vastly increased performance on JPEG processing by using a long-running exiftool process and named pipes to pass commands to it</div><div>- Made one instance of thumbor run on each available core on vagrant, since thumbor is single-threaded</div><div>- Debian packaging well under way: <a href="https://phabricator.wikimedia.org/T134485">https://phabricator.wikimedia.org/T134485</a> all dependencies covered except one. 14 backports and 17 new packages so far. Working with Filippo to get as many of these into Debian proper as possible.</div><div><br></div><div>Until next time,</div><div><br></div><div>Aaron, Gilles, Ori, Timo, and Peter</div><div><br></div></div>