Page MenuHomeMiraheze

section.execute-GitInfo->getHeadCommitDate is very slow
Closed, ResolvedPublic

Description

See comments, 92% of the time to load siteinfo Api with extensions is taken doing this. It should be cached.

https://phabricator.wikimedia.org/T131003 ?

Event Timeline

BrandonWM triaged this task as Normal priority.Nov 19 2020, 20:10
BrandonWM created this task.
Reception123 claimed this task.
Reception123 edited projects, added Upstream; removed Site Reliability Engineering.

Wiki-Bot#2998 is not operated or maintained by Miraheze, and as such there is nothing we can do about it unfortunately

BrandonWM reopened this task as Open.EditedNov 19 2020, 20:14

@Reception123 The dev is saying that it's Miraheze, not the bot that's the issue.

@BlackWidowMovie0000Editor Who is the dev, and how would it be our fault?

@BlackWidowMovie0000Editor Who is the dev, and how would it be our fault?

MarkusRost. He's on the support server. I can get the invite if you want.

I literally just went over this. And we're discussing in IRC right now, with the dev even saying it's an issue on Miraheze's end.

Unknown Object (User) closed this task as Invalid.Nov 22 2020, 07:29

Even if this is somehow related to Miraheze, I do not see how we would really fix it. In addition, this is not a service relating to Miraheze what-so-ever, and has no impact on our own services, as such once again, closing this task.

I've investigated the problem: the reason for timeouts when using Wiki-Bot is because it asks for the whole list of extensions. Miraheze wikis respond to that specific request (https://meta.miraheze.org/w/api.php?action=query&meta=siteinfo&siprop=general|extensions with |extensions) too slowly, slower than most MediaWiki sites, and that is why the bot has problems. Asking simply for general is fine. If I had to guess, it's probably something to do with ManageWiki. (Leaving this here for people searching this in the future.)

1100.00% 9223.385 1 - main()
2 98.68% 9101.326 1 - wfApiMain
3 98.65% 9099.154 1 - ApiMain::execute
4 98.65% 9099.153 1 - ApiMain::executeActionWithErrorHandling
5 98.63% 9097.408 1 - ApiMain::executeAction
6 95.63% 8820.098 108 - MediaWiki\Shell\Command::execute
7 93.74% 8646.296 1 - ApiQuery::execute
8 93.74% 8645.895 1 - ApiQuerySiteinfo::execute
9 93.55% 8628.697 1 - ApiQuerySiteinfo::appendExtensions
10 93.44% 8617.873 326 - stream_select
11 92.71% 8550.627 107 - GitInfo::getHeadCommitDate
12 92.17% 8501.164 107 - section.execute-GitInfo->getHeadCommitDate
13 5.83% 537.685 581 - MediaWiki\HookContainer\HookContainer::run
14 5.77% 532.221 271 - MediaWiki\HookContainer\HookContainer::callLegacyHook
15 4.79% 441.908 1 - ApiMain::printResult
16 4.77% 440.163 1 - ApiFormatBase::closePrinter
17 3.11% 287.291 8 - WANObjectCache::getWithSetCallback
18 3.11% 287.188 7 - WANObjectCache::fetchOrRegenerate
19 3.09% 284.896 1 - MediaWiki\Api\ApiHookRunner::onApiFormatHighlight
20 3.09% 284.872 1 - SyntaxHighlight::onApiFormatHighlight
21 3.09% 284.648 1 - SyntaxHighlight::highlight
22 3.01% 277.703 1 - SyntaxHighlight::{closure}
23 3.00% 276.926 1 - section.execute-SyntaxHighlight::{closure}
24 1.60% 147.541 1 - OutputPage::output
25 1.34% 123.619 108 - proc_open
26 1.28% 117.606 2 - CookieWarning\Decisions::shouldShowCookieWarning
27 1.27% 117.559 2 - CookieWarning\Decisions::isInConfiguredRegion
28 1.27% 117.542 2 - CookieWarning\Decisions::getCountryCodeFromIP
29 1.27% 116.785 2 - CookieWarning\HttpGeoLocation::locate
30 1.27% 116.716 2 - Http::get
31 1.27% 116.712 2 - Http::request
32 1.26% 116.632 2 - MediaWiki\Http\HttpRequestFactory::request
33 1.26% 116.441 2 - GuzzleHttpRequest::execute
34 1.25% 115.337 2 - GuzzleHttp\Client::send
35 1.25% 115.307 2 - GuzzleHttp\Client::sendAsync
36 1.25% 115.250 2 - GuzzleHttp\Client::transfer
37 1.25% 115.147 2 - GuzzleHttp\HandlerStack::__invoke
38 1.25% 115.137 10 - GuzzleHttp\Middleware::GuzzleHttp\{closure}
39 1.25% 115.100 2 - GuzzleHttp\RedirectMiddleware::__invoke
40 1.25% 115.098 2 - GuzzleHttp\PrepareBodyMiddleware::__invoke
41 1.25% 115.080 2 - GuzzleHttp\Middleware::GuzzleHttp\{closure}@1
42 1.25% 115.070 2 - GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}
43 1.25% 115.068 2 - GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}@1
44 1.25% 115.064 2 - GuzzleHttp\Handler\CurlHandler::__invoke
45 1.25% 115.036 1 - MediaWiki\HookContainer\HookRunner::onSetupAfterCache
46 1.25% 114.983 1 - CreateWikiHooks::onSetupAfterCache
47 1.24% 114.726 2 - curl_exec
48 1.13% 104.494 18 - Wikimedia\Rdbms\LoadBalancer::getConnection
49 1.13% 104.325 18 - Wikimedia\Rdbms\LoadBalancer::getServerConnection
50 1.13% 104.009 13 - wfGetDB
51 1.13% 103.811 13 - Wikimedia\Rdbms\LoadBalancer::getMaintenanceConnectionRef
52 1.10% 101.630 1 - CreateWikiJson::__construct
53 1.10% 101.308 2 - Wikimedia\Rdbms\LoadBalancer::reallyOpenConnection
54 1.09% 100.795 2 - Wikimedia\Rdbms\Database::initConnection
55 1.09% 100.791 2 - Wikimedia\Rdbms\Database::doInitConnection
56 1.09% 100.790 2 - Wikimedia\Rdbms\DatabaseMysqlBase::open
57 1.08% 99.642 2 - Wikimedia\Rdbms\DatabaseMysqli::mysqlConnect
58 1.08% 99.530 2 - mysqli::real_connect
59 1.03% 94.716 2 - Wikimedia\Rdbms\LoadBalancer::getForeignConnection
60 0.83% 76.152 1 - MediaWiki\HookContainer\HookRunner::onBeforePageDisplay
61 0.79% 72.922 1 - CookieWarning\Hooks::onBeforePageDisplay
62 0.76% 70.518 1 - SkinTemplate::outputPage
63 0.73% 67.631 1 - SkinMustache::generateHTML
64 0.56% 51.573 1 - SkinMustache::getTemplateData
65 0.51% 46.591 1 - Skin::afterContentHook
66 0.51% 46.582 1 - MediaWiki\HookContainer\HookRunner::onSkinAfterContent
67 0.50% 46.563 1 - CookieWarning\Hooks::onSkinAfterContent
68 0.38% 34.785 391 - Monolog\Logger::addRecord
69 0.34% 31.061 146 - Monolog\Logger::debug
70 0.28% 25.394 112 - Monolog\Handler\WhatFailureGroupHandler::handle
71 0.27% 25.222 112 - Monolog\Handler\AbstractProcessingHandler::handle
72 0.26% 23.678 40 - Message::toString
73 0.23% 21.267 410 - spl_autoload_call
74 0.21% 19.774 112 - Monolog\Handler\SyslogUdpHandler::write
75 0.20% 18.101 112 - Monolog\Handler\SyslogUdp\UdpSocket::write
76 0.19% 17.224 112 - Monolog\Handler\SyslogUdp\UdpSocket::send
77 0.19% 17.190 1 - ApiQuerySiteinfo::appendGeneralInfo
78 0.18% 16.833 112 - socket_sendto
79 0.18% 16.369 35 - Message::text
80 0.15% 14.212 2653 - Wikimedia\Services\ServiceContainer::getService
81 0.15% 13.959 1 - OutputPage::headElement
82 0.14% 13.082 434 - AutoLoader::autoload
83 0.14% 12.980 111 - GitInfo::__construct
84 0.14% 12.736 23 - Wikimedia\Services\ServiceContainer::createService
85 0.14% 12.588 25 - Wikimedia\Services\ServiceContainer::{closure}
86 0.13% 12.406 1 - SiteConfiguration::extractAllGlobals
87 0.13% 12.251 827 - SiteConfiguration::extractGlobalSetting
88 0.13% 11.607 831 - SiteConfiguration::processSetting
89 0.12% 11.231 118 - Title::getLinkURL
90 0.11% 10.510 3 - OutputPage::getRlClient
91 0.11% 9.993 109 - MediaWiki\ExtensionInfo::getLicenseFileNames
92 0.11% 9.874 218 - scandir
93 0.10% 9.645 119 - SpecialPage::getTitleFor
94 0.10% 9.632 54 - Message::fetchMessage
95 0.10% 9.448 123 - Title::getLocalURL
96 0.10% 9.235 47 - MessageCache::get
97 0.10% 9.219 107 - GitInfo::getHeadViewUrl
98 0.10% 8.905 3284 - Composer\Autoload\ClassLoader::loadClass
99 0.09% 8.307 47 - MessageCache::getMessageFromFallbackChain
100 0.09% 8.275 47 - MessageCache::getMessageForLang
101 0.09% 7.967 107 - GitInfo::getRemoteUrl
102 0.09% 7.929 115 - wfTimestamp
103 0.08% 7.801 117 - Wikimedia\Timestamp\ConvertibleTimestamp::convert
104 0.08% 7.438 47 - MessageCache::getMsgFromNamespace
105 0.08% 7.363 120 - SpecialPage::getTitleValueFor
106 0.08% 7.334 1 - ApiQueryBase::getDB
107 0.08% 7.329 1 - ApiBase::getDB
108 0.08% 7.168 2 - Message::parseText
109 0.08% 7.150 3 - Title::newMainPage
110 0.08% 7.087 2 - MessageCache::parse
111 0.08% 7.073 37 - Message::transformText
112 0.08% 7.061 2 - Parser::parse
113 0.08% 6.992 37 - MessageCache::transform
114 0.08% 6.955 1 - ApiMain::reportUnusedParams
115 0.07% 6.878 16 - Wikimedia\Rdbms\LoadBalancer::getLocalConnection
116 0.07% 6.829 1 - ApiBase::addWarning
117 0.07% 6.811 1 - ApiErrorFormatter::addWarning
118 0.07% 6.726 220 - file_get_contents
119 0.07% 6.660 47 - MessageCache::load
120 0.07% 6.598 1 - ApiErrorFormatter_BackCompat::addWarningOrError
121 0.07% 6.430 1 - Message::parseAsBlock
122 0.07% 6.379 6173 - preg_match
123 0.07% 6.002 2 - MediumSpecificBagOStuff::add
124 0.06% 5.991 2 - MemcachedPhpBagOStuff::doAdd
125 0.06% 5.984 3499 - Composer\Autoload\ClassLoader::findFile
126 0.06% 5.965 2 - MemcachedClient::add
127 0.06% 5.960 2 - MemcachedClient::_set
128 0.06% 5.917 107 - parse_ini_file
129 0.06% 5.898 32 - MemcachedClient::_fgets
130 0.06% 5.756 32 - fgets
131 0.06% 5.651 110 - GitInfo::getHeadSHA1
132 0.06% 5.637 1 - WANObjectCache::set
133 0.06% 5.534 34 - LCStoreCDB::get
134 0.06% 5.356 118 - Wikimedia\Timestamp\ConvertibleTimestamp::__construct
135 0.06% 5.328 3 - OutputPage::getRlClientContext
136 0.06% 5.231 118 - Wikimedia\Timestamp\ConvertibleTimestamp::setTimestamp
137 0.06% 5.127 6 - OutputPage::getResourceLoader
138 0.06% 5.121 1 - MediaWiki\MediaWikiServices::getResourceLoader
139 0.05% 5.040 15 - LocalisationCache::loadItem
140 0.05% 4.951 108 - MediaWiki\Shell\FirejailCommand::buildFinalCommand
141 0.05% 4.947 218 - GitInfo::getHead
142 0.05% 4.906 241 - wfDebugLog
143 0.05% 4.882 144 - spl_autoload_call@1
144 0.05% 4.878 112 - MediaWiki\Logger\Monolog\LogstashFormatter::format
145 0.05% 4.790 434 - proc_get_status
146 0.05% 4.738 15 - MemcachedClient::_load_items
147 0.05% 4.725 8 - Wikimedia\Rdbms\Database::query
148 0.05% 4.713 221 - LocalisationCache::getSubitem
149 0.05% 4.702 118 - SectionProfileCallback::__destruct
150 0.05% 4.634 120 - MediaWiki\SpecialPage\SpecialPageFactory::getLocalNameFor
151 0.05% 4.632 8 - Wikimedia\Rdbms\Database::executeQuery
152 0.05% 4.622 4 - ApiResult::addValue
153 0.05% 4.613 109 - MediaWiki\ExtensionInfo::getAuthorsFileName
154 0.05% 4.574 21 - LocalisationCache::loadSubitem
155 0.05% 4.531 8 - Wikimedia\Rdbms\Database::executeQueryAttempt
156 0.05% 4.500 3 - json_decode
157 0.05% 4.483 11 - MediumSpecificBagOStuff::getMulti
158 0.05% 4.420 11 - MemcachedPhpBagOStuff::doGetMulti
159 0.05% 4.375 11 - MemcachedClient::get_multi
160 0.05% 4.248 10 - WANObjectCache::get
161 0.05% 4.225 10 - WANObjectCache::getMulti
162 0.05% 4.199 1 - gzcompress
163 0.04% 4.137 118 - SectionProfiler::profileOutInternal
164 0.04% 4.080 1164 - Wikimedia\AtEase\AtEase::suppressWarnings
165 0.04% 4.078 24 - ResourceLoader::register
166 0.04% 4.040 73995 - array_key_exists
167 0.04% 4.014 108 - MediaWiki\Shell\Shell::command
168 0.04% 3.911 10 - WebRequest::getSession
169 0.04% 3.741 4 - ApiResult::validateValue
170 0.04% 3.695 2 - Parser::internalParse
171 0.04% 3.657 169 - ApiResult::validateValue@1
172 0.04% 3.629 8 - Wikimedia\Rdbms\DatabaseMysqli::doQuery
173 0.04% 3.608 6 - MediaWiki\Session\SessionManager::getGlobalSession
174 0.04% 3.573 1 - MediaWiki\Session\SessionManager::getSessionForRequest
175 0.04% 3.555 8 - mysqli::query
176 0.04% 3.554 1 - LocalisationCache::getSubitemList
177 0.04% 3.455 108 - MediaWiki\Shell\Command::buildFinalCommand
178 0.04% 3.449 258 - Title::prefix
179 0.04% 3.432 676 - is_readable
180 0.04% 3.232 3384 - Composer\Autoload\ClassLoader::findFileWithExtension
181 0.03% 3.210 960 - array_filter
182 0.03% 3.184 501 - fread
183 0.03% 3.051 1306 - ApiResult::validateValue@2
184 0.03% 3.044 1 - MediaWiki\Session\SessionManager::getEmptySession
185 0.03% 3.042 1 - MediaWiki\Session\SessionManager::getEmptySessionInternal
186 0.03% 3.023 2 - Parser::internalParseHalfParsed
187 0.03% 2.991 68 - Wikimedia\Services\ServiceContainer::getService@1
188 0.03% 2.957 15 - Wikimedia\Services\ServiceContainer::createService@1
189 0.03% 2.956 241 - Monolog\Logger::info
190 0.03% 2.929 34 - unserialize
191 0.03% 2.913 256 - Title::getNsText
192 0.03% 2.901 188 - call_user_func_array
193 0.03% 2.871 472 - SectionProfiler::getTime
194 0.03% 2.857 16 - Wikimedia\Services\ServiceContainer::{closure}@1
195 0.03% 2.809 111 - GitInfo::getCacheFilePath
196 0.03% 2.730 1 - Skin::initPage
197 0.03% 2.729 1 - Skin::preloadExistence
198 0.03% 2.651 6 - MessageCache::getParser
199 0.03% 2.640 112 - MediaWiki\Logger\Monolog\WikiProcessor::__invoke
200 0.03% 2.620 1 - MediaWiki\MediaWikiServices::getParser
201 0.03% 2.602 18 - Wikimedia\Rdbms\LoadBalancer::isMasterConnectionReadOnly
202 0.03% 2.579 2 - MWTidy::tidy
203 0.03% 2.573 4 - Parser::transformMsg
204 0.03% 2.563 4 - Parser::preprocess
205 0.03% 2.515 2 - MediaWiki\Tidy\RemexDriver::tidy
206 0.03% 2.509 87 - Composer\Autoload\includeFile
207 0.03% 2.497 10 - MediaWiki\Session\SessionManager::getSessionFromInfo
208 0.03% 2.493 1 - OutputPage::getJSVars
209 0.03% 2.491 124 - Title::getPrefixedText
210 0.03% 2.440 19 - BagOStuff::getWithSetCallback
211 0.03% 2.434 582 - Wikimedia\AtEase\AtEase::restoreWarnings
212 0.03% 2.423 121 - MediaWiki\HookContainer\HookRunner::onGetLocalURL__Article
213 0.03% 2.373 118 - AutoLoader::autoload@1
214 0.03% 2.366 34 - Cdb\Reader\DBA::get
215 0.03% 2.352 48 - Wikimedia\Rdbms\LoadBalancer::Wikimedia\Rdbms\{closure}
216 0.03% 2.352 112 - Monolog\Formatter\NormalizerFormatter::format
217 0.03% 2.322 34 - dba_fetch
218 0.02% 2.299 32 - MediumSpecificBagOStuff::get
219 0.02% 2.261 118 - ProfilerXhprof::scopedProfileIn
220 0.02% 2.257 112 - Monolog\Formatter\NormalizerFormatter::normalize
221 0.02% 2.250 4 - Wikimedia\Rdbms\DatabaseMysqlBase::serverIsReadOnly
222 0.02% 2.225 10 - Parser::replaceVariables
223 0.02% 2.204 1081 - escapeshellarg
224 0.02% 2.156 75 - Wikimedia\ScopedCallback::__destruct
225 0.02% 2.062 118 - Wikimedia\Timestamp\ConvertibleTimestamp::getTimestamp
226 0.02% 2.059 137 - Title::newFromLinkTarget
227 0.02% 2.045 66 - Wikimedia\ScopedCallback::consume
228 0.02% 2.022 4 - RemexHtml\Tokenizer\Tokenizer::execute
229 0.02% 2.008 13 - Title::newFromText
230 0.02% 2.008 10 - MediaWiki\Session\SessionBackend::MediaWiki\Session\{closure}
231 0.02% 2.000 12 - MediaWiki\Session\SessionBackend::save
232 0.02% 1.991 13 - Title::newFromTextThrow
233 0.02% 1.978 1 - ParserFactory::create
234 0.02% 1.973 1 - Parser::__construct
235 0.02% 1.965 8 - Parser::firstCallInit
236 0.02% 1.955 118 - SectionProfiler::scopedProfileIn
237 0.02% 1.953 1227 - Language::normalize
238 0.02% 1.942 40 - Wikimedia\Services\ServiceContainer::getService@2
239 0.02% 1.939 4 - MemcachedPhpBagOStuff::doGet
240 0.02% 1.921 4 - MemcachedClient::get
241 0.02% 1.920 10 - Wikimedia\Services\ServiceContainer::createService@2
242 0.02% 1.893 279 - MediaWiki\Logger\LoggerFactory::getInstance
243 0.02% 1.892 2 - Parser::handleInternalLinks
244 0.02% 1.888 132 - MediaWiki\SpecialPage\SpecialPageFactory::getAliasList
245 0.02% 1.877 2 - Parser::handleInternalLinks2
246 0.02% 1.858 10 - Wikimedia\Services\ServiceContainer::{closure}@2
247 0.02% 1.812 4 - section.query-m: SELECT @@GLOBAL.read_only AS Value
248 0.02% 1.803 36 - array_flip
249 0.02% 1.787 108 - MediaWiki\Shell\FirejailCommand::params
250 0.02% 1.774 18 - Wikimedia\Rdbms\DBConnRef::__call
251 0.02% 1.772 700 - ResourceLoader::isFileModule
252 0.02% 1.769 1 - Skin::getSiteNotice
253 0.02% 1.769 12 - Title::secureAndSplit
254 0.02% 1.744 260 - MediaWikiTitleCodec::getNamespaceName
255 0.02% 1.735 1227 - UtfNormal\Validator::cleanUp
256 0.02% 1.707 6 - MessageCache::getParserOptions
257 0.02% 1.690 1 - MediaWiki\HookContainer\HookRunner::onSiteNoticeAfter
258 0.02% 1.669 1 - ApiFormatJson::execute
259 0.02% 1.669 784 - Monolog\Formatter\NormalizerFormatter::normalize@1
260 0.02% 1.664 1 - LinkBatch::execute
261 0.02% 1.663 1 - LinkBatch::executeInto
262 0.02% 1.642 1 - ParserOptions::__construct
263 0.02% 1.641 2 - ResourceLoaderWikiModule::preloadTitleInfo
264 0.02% 1.621 12 - MediaWikiTitleCodec::splitTitleString
265 0.02% 1.606 21 - Wikimedia\ObjectFactory::getObjectFromSpec
266 0.02% 1.585 128 - is_subclass_of
267 0.02% 1.582 236 - getrusage
268 0.02% 1.581 124 - Title::makeTitle
269 0.02% 1.580 1 - SkinMustache::buildSearchProps
270 0.02% 1.580 327 - fclose
271 0.02% 1.560 1 - MirahezeMagicHooks::onSiteNoticeAfter
272 0.02% 1.558 1798 - MediaWiki\Shell\Command::MediaWiki\Shell\{closure}
273 0.02% 1.548 1 - StubObject::unstub
274 0.02% 1.545 1 - StubObject::_unstub
275 0.02% 1.539 2 - Wikimedia\Rdbms\Database::select
276 0.02% 1.534 21 - MediaWiki\User\UserOptionsManager::getOption
277 0.02% 1.514 44 - RequestContext::getLanguage
278 0.02% 1.510 1 - LinkBatch::doQuery
279 0.02% 1.507 1 - StubUserLang::_newObject
280 0.02% 1.500 1 - CookieWarning\Hooks::generateElements
281 0.02% 1.498 1 - ApiMain::__construct
282 0.02% 1.498 13 - User::getOption
283 0.02% 1.497 370 - Monolog\DateTimeImmutable::__construct
284 0.02% 1.490 1 - ResourceLoaderClientHtml::getHeadHtml
285 0.02% 1.485 1 - RemoteWiki::__construct
286 0.02% 1.461 22 - MediaWiki\User\UserOptionsManager::loadUserOptions
287 0.02% 1.461 112 - Monolog\Formatter\NormalizerFormatter::toJson
288 0.02% 1.459 113 - WikiMap::getCurrentWikiId
289 0.02% 1.458 593 - MediaWiki\HookContainer\HookContainer::getHandlers
290 0.02% 1.438 109 - Wikimedia\AtEase\AtEase::quietCall
291 0.02% 1.410 118 - SectionProfiler::profileInInternal
292 0.02% 1.405 438 - realpath
293 0.02% 1.399 137 - Title::getPrefixedDBkey
294 0.02% 1.397 133 - json_encode
295 0.01% 1.371 227 - is_file
296 0.01% 1.362 1 - ApiMain::checkExecutePermissions
297 0.01% 1.362 112 - Monolog\Utils::jsonEncode
298 0.01% 1.338 1 - CentralAuthSessionProvider::unpersistSession
299 0.01% 1.320 2 - RemexHtml\TreeBuilder\Dispatcher::startDocument
300 0.01% 1.318 123 - TitleValue::__construct
301 0.01% 1.310 2 - ApiResult::getResultData
302 0.01% 1.309 20 - ApiBase::extractRequestParams
303 0.01% 1.308 108 - MediaWiki\Shell\Command::params
304 0.01% 1.306 594 - MediaWiki\HookContainer\HookContainer::getLegacyHandlers
305 0.01% 1.305 262 - wfUrlencode
306 0.01% 1.297 1 - ApiResult::applyTransformations
307 0.01% 1.282 2 - ApiResult::applyTransformations@1
308 0.01% 1.270 3 - ApiResult::applyTransformations@2
309 0.01% 1.268 208 - WebRequest::getVal
310 0.01% 1.249 6 - PPFrame_Hash::expand
311 0.01% 1.239 889 - Language::caseFold
312 0.01% 1.226 1 - OutputPage::getHeadLinksArray
313 0.01% 1.213 1160 - error_reporting
314 0.01% 1.211 5 - MediaWiki\User\DefaultOptionsLookup::getDefaultOptions
315 0.01% 1.198 398 - Hooks::runner
316 0.01% 1.182 108 - MediaWiki\Shell\CommandFactory::create
317 0.01% 1.165 1267 - MediaWiki\MediaWikiServices::getContentLanguage
318 0.01% 1.162 13609 - strtr
319 0.01% 1.160 370 - DateTimeImmutable::__construct
320 0.01% 1.156 27 - LocalisationCache::getItem
321 0.01% 1.151 4 - Monolog\Logger::error
322 0.01% 1.124 10 - MediaWiki\MediaWikiServices::getPermissionManager
323 0.01% 1.118 2 - ApiBase::getPermissionManager
324 0.01% 1.109 108 - MediaWiki\Shell\Shell::escape
325 0.01% 1.104 117 - ApiResult::applyTransformations@3
326 0.01% 1.101 135 - TitleValue::assertValidSpec
327 0.01% 1.092 260 - Language::getNsText
328 0.01% 1.080 889 - Language::uc
329 0.01% 1.064 5 - Parser::braceSubstitution
330 0.01% 1.063 110 - wfGetCaller
331 0.01% 1.056 13 - Wikimedia\ObjectFactory::createObject
332 0.01% 1.046 279 - MediaWiki\Logger\MonologSpi::getLogger
333 0.01% 1.045 1 - SkinMustache::tailElement
334 0.01% 1.038 193 - file_exists
335 0.01% 1.036 125 - MediaWiki\Interwiki\ClassicInterwikiLookup::fetch
336 0.01% 1.031 2 - Title::getCanonicalURL
337 0.01% 1.028 96 - call_user_func
338 0.01% 1.024 1 - MediaWiki\HookContainer\HookRunner::onParserFirstCallInit
339 0.01% 1.021 2 - MediaWiki\SpecialPage\SpecialPageFactory::getPageList
340 0.01% 1.020 1 - ApiMain::lacksSameOriginSecurity
341 0.01% 1.020 1 - Language::getMonthNamesArray
342 0.01% 1.015 14 - ApiBase::getHookRunner
343 0.01% 1.014 12 - Language::getMonthName
344 0.01% 1.011 1 - CentralAuthUtils::setP3P
345 0.01% 1.010 12 - Language::getMessageFromDB
346 0.01% 1.008 3 - Skin::footerLinkTitle
347 0.01% 1.008 1 - Skin::printSource
348 0.01% 1.004 1 - MediaWiki\HookContainer\HookRunner::onUserGetDefaultOptions
349
350-->

Redmin edited subscribers, added: Redmin; removed: BrandonWM.
RhinosF1 renamed this task from Wiki-Bot to section.execute-GitInfo->getHeadCommitDate is very slow.May 7 2021, 19:02
RhinosF1 updated the task description. (Show Details)

Updated title/description to actually state the issue

In T6471#144193, @Lev wrote:

I've investigated the problem: the reason for timeouts when using Wiki-Bot is because it asks for the whole list of extensions. Miraheze wikis respond to that specific request (https://meta.miraheze.org/w/api.php?action=query&meta=siteinfo&siprop=general|extensions with |extensions) too slowly, slower than most MediaWiki sites, and that is why the bot has problems. Asking simply for general is fine. If I had to guess, it's probably something to do with ManageWiki. (Leaving this here for people searching this in the future.)

The bot is asking for extensions only for a few requests (setup and test) to make sure the wiki has all the extensions for full bot functionality. But those extensions are no longer as required as before (I have pretty well working fallback code if they are missing).
Therefore I'll look into removing the extensions part from my requests over the next few days.

GitInfo::getHeadCommitDate tries to fetch the timestamp of the last commit for each extension. This can be very slow:

southparkfan@mw8:/srv/mediawiki/w/extensions/VisualEditor$ time git show -s --format=format:%ct HEAD
1620421442

real    0m0.892s
user    0m0.006s
sys     0m0.012s

southparkfan@mw8:/srv/mediawiki/w/extensions/Wikibase$ time git show -s --format=format:%ct HEAD
1616149709

real    0m1.892s
user    0m0.008s
sys     0m0.019s

(subtract 0.0010s for overhead)

The cause? Disk access (according to strace: lstat/read/stat/openat). However, fetching the timestamp a second time reduces the response time to 0m0.006s, because the files in the .git/ directory are cached in memory. I am aware our HDDs are not fast, that will not be 'fixed' in the near future. MediaWiki shouldn't make so many I/O calls in the first place.

Per https://phabricator.wikimedia.org/T131003#5228332, we could add $wgGitInfoCacheDirectory backport https://gerrit.wikimedia.org/r/c/mediawiki/core/+/513729/ to MirahezeMagic. Adding a json file for caching will reduce I/O by a huge margin.

Unknown Object (User) added a comment.May 22 2021, 10:10

@Southparkfan I do not think we can backport that patch do the change to includes/GitInfo.php, unless the script would work without that change, in which case we could.

@Southparkfan I do not think we can backport that patch do the change to includes/GitInfo.php, unless the script would work without that change, in which case we could.

Not sure the script can be used withour the custom patch.

Other than that, this task's priority can be lowered, I think?

Unknown Object (User) moved this task from Backlog to Long Term on the MediaWiki (SRE) board.Jun 15 2021, 17:08
Reception123 lowered the priority of this task from Normal to Low.Jun 20 2021, 16:54
Reception123 assigned this task to Unknown Object (User).