MediaWiki-Docker/Configuration recipes/Profiling

Plaintext profiler
MediaWiki-Docker comes with php-tideways pre-installed, which provides support for profiling web requests and maintenance scripts. This result is the same as in production with WikimediaDebug#Plaintext_request_profile.

Add once to LocalSettings.php:

Flame graph
MediaWiki-Docker does not yet come with php-excimer installed. The first time you use this, run the following steps: you@home:mediawiki$ docker compose exec --user root mediawiki bash root@docker in /w$ apt-get update; apt-get install php-excimer; curl ' https://raw.githubusercontent.com/brendangregg/FlameGraph/810687f180f3c4929b5d965f54817a5218c9d89b/flamegraph.pl' > /usr/local/bin/flamegraph.pl chmod +x /usr/local/bin/flamegraph.pl; exit; you@home:mediawiki$ docker compose restart And, add once to LocalSettings.php: After making a request with forceflame=1 set, you should find a flamegraph at http://mw.localhost:8080/w/docs/flamegraph.svg