Profiling

The various profilers supported out of the box.

This environment supports Xdebug and Blackfire for profiling your application.

In the interests of performance, profilers are not installed by default. To enable each follow the relevant instructions below.

It is not possible, or advised, to have both profilers running simultaneously.

Xdebug

Installation

Execute the following command to build a webserver container with the Xdebug extension enabled.

make build-xdebug

Configuration

Tweak Xdebug's configuration by editing docker/webserver/apache-*-php72/templates/xdebug.ini

Running

Follow Xdebug's docs for information on how to trigger Xdebug profiling.

Blackfire

Installation

Execute the following command to build a webserver container with the Blackfire agent and probe enabled.

make build-blackfie

Configuration

Tweak Blackfire's configuration by editing docker/webserver/apache-*-php72/templates/blackfire.ini

Running

The simplest way to profile a page is via the CLI:

# Enter the webserver container
make ssh

# Start profiling
blackfire curl -K https://localhost

The -K flag is passed to curl to ignore the self-signed certificate for localhost.

More information available at Blackfire's docs.

Last updated

Was this helpful?