In Wikimedia production, we profile MediaWiki in two ways:
- Request profiling for debugging – see T206152.
- Sampling profiles for production - this task.
This is currently collected from all production servers/requests via the internal HHVM sampling profiler ("Xenon") and periodically collected from HHVM's parent process.
- Instrumentation code:
The Xenon sampling profiler is enabled by default for us in production for all requests. There is no run-time toggle. During request shutdown, we ask HHVM for data. The data is internally buffered by HHVM which means it usually doesn't return anything yet, and then at certain intervals it yields a buffer of what it's got since the last flush, which we send to a Redis queue from which we then produce aggregated log files and flame graphs, published at <https://performance.wikimedia.org/.
- Find or create a sampling profiler for PHP 7. – T205059
- Install the profiler in production.
- Generalise the arc-lamp ingestion pipeline to support a second queue. – T195312
- Set up Redis writer in wmf-config for Excimer (use a separate Redis topic).
- Enable capturing and flushing of PHP 7 samples to this queue.