Configure Blackfire
You can add Blackfire to your Cloud Docker for Commerce environment to fully automate performance testing.
Blackfire.io for Adobe Commerce on cloud infrastructure is a PHP profiler and automated performance testing tool for use in development, integration, staging, and production environments. It enables you to locate and investigate performance issues in your environment at the code level and creates a performance profile by tracking every PHP call, method, and SQL query performed by your code.
You must have a Blackfire license and account to use Blackfire with Adobe Commerce on cloud infrastructure projects. See Adobe Commerce Cloud support or Blackfire for Magento on the Blackfire.io website.
To add Blackfire.io to your project configuration:
Add the following Blackfire.io configuration to the
runtime:extensions
section of the.magento.app.yaml
file.Copied to your clipboardruntime:extensions:- random-extension-here-name: blackfireconfiguration:server_id: SERVER_IDserver_token: SERVER_TOKENclient_id: CLIENT_IDclient_token: CLIENT_TOKENGenerate the
docker-compose.yml
file for developer mode, adding any required build or service configuration options and file synchronization options if needed.Copied to your clipboard./vendor/bin/ece-docker build:compose --mode="developer"Start the Cloud Docker for Commerce environment.
Copied to your clipboard./bin/magento-docker upCopied to your clipboard./bin/magento-docker ece-redeployIf you are using file synchronization, synchronize files as needed. See Launch Docker in developer mode.
Add context to use locally customized PHP images as described in Extend the Docker configuration.
Install Adobe Commerce in your Docker environment.
Deploy Adobe Commerce in the Docker container.
Copied to your clipboarddocker compose run --rm deploy cloud-deployCopied to your clipboarddocker compose run --rm deploy magento-command deploy:mode:set developerRun post-deploy hooks.
Copied to your clipboarddocker compose run --rm deploy cloud-post-deploy
Review messages and notifications during the deployment process and address any errors or notifications as needed.
Enable the Varnish cache for the Adobe Commerce application.
Copied to your clipboarddocker compose run --rm deploy magento-command config:set system/full_page_cache/caching_application 2 --lock-envCopied to your clipboarddocker compose run --rm deploy magento-command setup:config:set --http-cache-hosts=varnishClear the cache.
Copied to your clipboarddocker compose run --rm deploy magento-command cache:cleanMake sure that necessary containers are up and running.
Copied to your clipboarddocker compose ps
To use Blackfire.io for performance testing in Cloud Docker:
Install a profiling client as described in the Blackfire documentation.
Profile the Adobe Commerce website.