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
This commit is contained in:
parent
5e4facec78
commit
98c6743413
1 changed files with 7 additions and 0 deletions
7
load.php
7
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' ),
|
||||
|
|
|
|||
Loading…
Reference in a new issue