Profile your PHP Applications with BlackFire
There are so many situations where you really want to monitor the performance of your web apps.
Sometimes you want to know why a certain part of the app takes donkey hours to load, other times you just want to find out ways you can increase the load time of your app.
One very good solution that gives you awesome analysis about it right now is BlackFire.
Blackfire was created by Sensiolabs ( the creator of Symfony) and it has a lot of goodies.
You have to install the Blackfire extension on your server and you can also install it on your system to enable you profile an API or a CLI application.
Follow the instructions on Blackfire site to get started.
Once you are done with that, like I said. It has to be installed on your Server.
For someone like me that uses Heroku and Forge a lot of the times:
Heroku: Just go to your dashboard addons section and look for BlackFire and install.
You can also install it via your CLI like so:
heroku addons:create blackfire
and setting the config like so:
$ heroku config:get BLACKFIRE_SERVER_ID
$ heroku config:get BLACKFIRE_SERVER_TOKEN
where BLACKFIRE_SERVER_ID and BLACKFIRE_SERVER_TOKEN are your server id and tokens respectively.
For Forge users, just update the Blackfire form like so:
The easiest way to debug an application on a server where Blackfire is installed is to get the Chrome extension . Then go on a webpage, click on the Blackfire icon, and then on the big red “Profile” button. You will see a bar appear at the top of your page, it’ll run for a very short while and then give you information about the current request. It’s that simple!!!
For this case, I’ll profile an open source food social network that’s been built by some talented fellows with Laravel right now. Click here to check it out.
Now, with these above, there are lots of information concerning your page load speed, various components of your app with the various requests and their respective speeds, the size of RAM been loaded at various route calls.
You can also profile APIs and web services like so:
blackfire run http://niceapi.com/api
Blackfire offers a lot of analysis. It’s still been actively developed to be better than what is right now but you should definitely try it out.
Please let me know if you have any questions or observations in the comments section below.
- How to build your own Youtube – Part 10 - August 1, 2016
- How to build your own Youtube – Part 9 - July 25, 2016
- How to build your own Youtube – Part 8 - July 23, 2016
- How to build your own Youtube – Part 6 - July 6, 2016
- Introducing Laravel Password v1.0 - July 3, 2016
- How to build your own Youtube – Part 5 - June 28, 2016
- How to build your own Youtube – Part 4 - June 23, 2016
- How to build your own Youtube – Part 3 - June 15, 2016
- How to build your own Youtube – Part 2 - June 8, 2016
- How to build your own Youtube – Part 1 - June 1, 2016