In this guide, we will show you how to quickly monitor the bottleneck in your code in production mode on Magento.
Why you may need to integrate Magento with New Relic. Possible Cases:
- You have launched the Magento 2 Store and are not sure that during the development process, you considered all the performance issues that may occur.
- You have installed third-party extensions that may have performance issues
- You want to save time on profiling errors and bottlenecks that can happen in production mode of your Magento store.
- You want to catch mistakes that occur during production, and quickly fix them.
Now let’s proceed to the New Relic installation.
Create New Relic account
Go to the New Relic website and create an account. You can do it here: : https://newrelic.com/signup
Add new Application
Go to APM (Application Performance Monitoring) -> Applications and choose “Add more”
Choose PHP Application
Install NewRelic PHP agent
Follow the instructions:
4.1. Select the operating system and copy the command to the console to install the NewRelic PHP agent
4.2. During the installation, you will need to enter a new relic key.
It is available at the first step.
4.3. When you start working with the Magento site in the browser, the new relic agent will start sending data to the New Relic service server.
Before doing this, we recommend customized sign your application:
It can be done:
- In newrelic.ini, the directive is newrelic.appname
- At the application level (eg .htaccess, virtual host config).
Collecting transaction traces
After the user logs on to the Magento store, New Relic starts collecting data. In the APM -> Applications section, you will see a line with the name of the application.
To receive detailed transactions traces, you need to integrate Magento with New Relic through the API
System -> Configuration -> General -> New Relic Reporting
Clicking on the link with the name of the application, you will see beautiful charts and reports.
The main metrics are the response time from the server and the download time of all the files in the browser.
You can learn each transaction in greater details in the section “Transactions”. Find the longest queries in the “Database” section
Happy debugging and problem solving with Magento & New Relic integration! 🙂