From 98c6743413118f658a214f2c2829b15d519fecdc Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 28 Sep 2016 21:37:20 +0100 Subject: [PATCH] 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 --- load.php | 7 +++++++ 1 file changed, 7 insertions(+) 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' ), -- 2.20.1