Edit in GitHubLog an issue

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.

To add Blackfire.io to your project configuration:

  1. Add the following Blackfire.io configuration to the runtime:extensions section of the .magento.app.yaml file.

    Copied to your clipboard
    runtime:
    extensions:
    - random-extension-here
    -
    name: blackfire
    configuration:
    server_id: SERVER_ID
    server_token: SERVER_TOKEN
    client_id: CLIENT_ID
    client_token: CLIENT_TOKEN
  2. Generate 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"
  3. Start the Cloud Docker for Commerce environment.

    Copied to your clipboard
    ./bin/magento-docker up
    Copied to your clipboard
    ./bin/magento-docker ece-redeploy

    If you are using file synchronization, synchronize files as needed. See Launch Docker in developer mode.

  4. Add context to use locally customized PHP images as described in Extend the Docker configuration.

  5. Install Adobe Commerce in your Docker environment.

    • Deploy Adobe Commerce in the Docker container.

      Copied to your clipboard
      docker compose run --rm deploy cloud-deploy
      Copied to your clipboard
      docker compose run --rm deploy magento-command deploy:mode:set developer
    • Run post-deploy hooks.

      Copied to your clipboard
      docker compose run --rm deploy cloud-post-deploy

    Review messages and notifications during the deployment process and address any errors or notifications as needed.

  6. Enable the Varnish cache for the Adobe Commerce application.

    Copied to your clipboard
    docker compose run --rm deploy magento-command config:set system/full_page_cache/caching_application 2 --lock-env
    Copied to your clipboard
    docker compose run --rm deploy magento-command setup:config:set --http-cache-hosts=varnish
  7. Clear the cache.

    Copied to your clipboard
    docker compose run --rm deploy magento-command cache:clean
  8. Make sure that necessary containers are up and running.

    Copied to your clipboard
    docker compose ps

To use Blackfire.io for performance testing in Cloud Docker:

  1. Install a profiling client as described in the Blackfire documentation.

  2. Profile the Adobe Commerce website.

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.