This add-on is operated by SensioLabs
Fire up your PHP App Performance
Last updated 10 February 2016
The Blackfire.io add-on is currently in beta.
Table of Contents
Blackfire is a profiler that lets you optimize your PHP app performance. Its interactive call graphs make it very easy to find bottlenecks and improve performance, compare profiles and figure out the impact of your changes.
The Blackfire Heroku add-on provides a convenient and easy way to start profiling your PHP apps in minutes, and improve the performance of your apps running on Heroku. Find out how your apps behave on dev and prod servers, and with no overhead for other requests.
This document explains how to set up your add-on in a few simple steps, and how to start profiling your apps in a few minutes.
Provisioning the add-on
A list of all plans available can be found here.
Blackfire can be configured to work with any PHP application on Heroku via the CLI:
$ heroku addons:create blackfire -----> Adding Blackfire to sharp-mountain-4005... done, v18 (free)
Once Blackfire has been added,
BLACKFIRE_SERVER_TOKEN settings will be available in the app configuration and will contain the credentials required to push profiling data to Blackfire. This can be confirmed using the
heroku config:get command.
$ heroku config:get BLACKFIRE_SERVER_ID $ heroku config:get BLACKFIRE_SERVER_TOKEN
With these config variables present, the PHP extension for Blackfire will automatically be installed the next time you deploy. You can simply push an empty commit to finalize installation:
$ git commit --allow-empty -m "redeploy with Blackfire enabled" $ git push heroku master ... remote: -----> PHP app detected remote: -----> Resolved 'composer.lock' requirement for PHP to version 5.6.15. remote: -----> Installing system packages... remote: - PHP 5.6.15 remote: - Apache 2.4.16 remote: - Nginx 1.8.0 remote: -----> Installing PHP extensions... remote: - blackfire (add-on detected; downloaded) ...
After installing the Blackfire add-on, your application should be configured to allow its profiling. You then just have to install the Blackfire Chrome extension (see below) to start profiling your first web app.
Accessing the Blackfire Dashboard
The Blackfire dashboard allows you to view the list of your stored profiles, access each profile and eventually compare 2 profiles. Upon creation of your Blackfire account, the dashboard is pre-populated with 2 sample profiles for you to play with. You may delete them if you don’t want to use them.
For more information on the features available within the Blackfire dashboard please see the docs at blackfire.io.
The dashboard can be accessed via the CLI:
$ heroku addons:open blackfire Opening Blackfire for sharp-mountain-4005
or by visiting the Heroku Dashboard and selecting the application in question. Select Blackfire from the Add-ons menu.
Profiling a web application
The easiest way to profile a web page is by using Blackfire’s Chrome Extension. Once it is installed, log into your Blackfire dashboard (see above), and start profiling your web page in just one click, directly from your browser.
For more information about the how to use Blackfire, check-out the 24 days of Blackfire tutorials.
Migrating between plans
Application owners should carefully manage the migration timing to ensure proper application function during the migration process.
heroku addons:upgrade command to migrate to a new plan.
$ heroku addons:upgrade blackfire:newplan -----> Upgrading ADDON-SLUG:newplan to sharp-mountain-4005... done, v18 ($49/mo) Your plan has been updated to: ADDON-SLUG:newplan
Removing the add-on
Blackfire can be removed via the CLI.
This will destroy all associated data and cannot be undone!
$ heroku addons:destroy blackfire -----> Removing Blackfire from sharp-mountain-4005... done, v20 (free)
All Blackfire support and runtime issues should be submitted via one of the Heroku Support channels. Any non-support related issues or product feedback is welcome at blackfire.io, through the feedback form that is available when logged in.