What is Blackfire?
Blackfire is a PHP profiling solution. It is a measurement tools that tells you exactly how your code behaves and how it is consuming resources. Based in those measurements, Blackfire enables developers to write performance tests, and to pro-actively manage the performance of their code, even before it is pushed to production. In production, it provides a whole new level of details and information about the code's behaviour, with no overhead for end-users.
What is an APM/what is New Relic?
APM here means Application Performance Monitoring solution. It is a solution which mostly makes sense on production servers, and is much less efficient in dev/test/staging.
New Relic is an APM. It monitors mobile and web applications in real-time, enabling developers to diagnose and fix application performance problems. It is a great complement to Blackfire.
Why are those tools different?
In PHP, measuring performance impacts performance. In order to measure the performance of some code, you need to instrument it. You need some extra code to be executed in order to calculate how much your own code is consuming. that creates an overhead.
- New Relic, in order to provide their level of data, instruments all end users requests. So they add an overhead for all end-users visit the site/using the app. In order to keep that overhead limited, they do not gather too much information about the code execution.
- Blackfire never looks at end user requests. It only instruments automatically the single requests which are triggered by a developer or a developer tool for profiling purposes. It is therefore totally safe to use in production.
Blackfire/New Relic integration
Whenever New Relic detects a slow page, it triggers a Blackfire profile to quickly analyze and resolve detected problems. To know more about the differences between New Relic and Blackfire.io, please read this chapter of the 24 days of Blackfire.
Blackfire supports a native integration with New Relic, which can automate the triggering of Blackfire test scenarios on given events from New Relic. For instance, any alert you set-up in New Relic for your application or key transaction can enable Blackfire to run tests on a pre-defined scenario.