From: Timo Tijhof Date: Wed, 28 Sep 2016 20:37:20 +0000 (+0100) Subject: resourceloader: Disable ChronologyProtector to speed up wfGetLB() X-Git-Tag: 1.31.0-rc.0~5283^2 X-Git-Url: https://git.cyclocoop.org/admin/%7B%24plugin.url%7Cescape%7D?a=commitdiff_plain;h=98c6743413118f658a214f2c2829b15d519fecdc;p=lhc%2Fweb%2Fwiklou.git resourceloader: Disable ChronologyProtector to speed up wfGetLB() For load.php requests, Xenon in Wikimedia production measures that half the time for wfGetLB() is spent in ChronologyProtector::initPositions, and its query to Memcached. Change-Id: I24f90897e56fd679c6bd1acf764722ed58e51c67 --- diff --git a/load.php b/load.php index c832237059..974771f978 100644 --- a/load.php +++ b/load.php @@ -23,6 +23,7 @@ */ use MediaWiki\Logger\LoggerFactory; +use MediaWiki\MediaWikiServices; // This endpoint is supposed to be independent of request cookies and other // details of the session. Enforce this constraint with respect to session use. @@ -35,6 +36,12 @@ if ( !$wgRequest->checkUrlExtension() ) { return; } +// Don't initialise ChronologyProtector from object cache, and +// don't wait for unrelated MediaWiki writes when querying ResourceLoader. +MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [ + 'ChronologyProtection' => 'false', +] ); + // Set up ResourceLoader $resourceLoader = new ResourceLoader( ConfigFactory::getDefaultInstance()->makeConfig( 'main' ),