MediaWiki-Docker/Configuration recipes/Performance profiling with XHProf

From mediawiki.org
Jump to navigation Jump to search

Performance profiling with XHProf[edit]

You can use XHProf to profile requests.

docker-compose.override.yml

TODO: Adapt something from https://github.com/perftools/xhgui/blob/master/docker-compose.yml

LocalSettings.php
// Change to `true` when you want to profile a request.
if ( false ) {
	$wgProfiler['class'] = ProfilerXhprof::class;
	$wgProfiler['flags'] = TIDEWAYS_XHPROF_FLAGS_NO_BUILTINS;
	$wgProfiler['output'] = [ 'ProfilerOutputDump' ];
	$wgProfiler['outputDir'] = sys_get_temp_dir();
}