Skip to main content

SPX

SPX provides development teams with a tool to profile and debug performance issues.

SPX is packaged in our Alpine Packages Repository and installed by default in our local development images.

Why use SPX?​

As stated on the project's README.md:

How to use SPX​

Browser​

Command Line​

Execute any command prefixed with the following environment variables:

SPX_ENABLED=1
SPX_REPORT=full

e.g.

SPX_ENABLED=1 SPX_REPORT=full drush cr

Debugging​

I cannot see my profiling data​

This is generally a permissions issue.

SPX does not provide any warnings/errors when it cannot write to the directory where the profiling data is stored.

This directory is (by default):

/tmp/spx

and should have the permissions:

  • Inside the Skpr container: skpr:skpr
  • Outside of the Skpr container: 1000:1000

I cannot see my profiling command line profiling data in the Web UI​

This is generally:

  • Permissions issue (see previous debugging section)
  • The profiling data directory is not mounted between the CLI container and the PHP/Web container.

Below is an example of the Docker Compose services php-fpm and php-cli where the profiling data is shared using a volume.

services:
php-fpm:
- ./.docker/tmp/spx:/tmp/spx

php-cli:
volumes:
- ./.docker/tmp/spx:/tmp/spx