Configure a new relic project for Magento 2 to monitor the performance of your store efficiently.

Because of thatYou can track every request, optimize transactions, and prevent slowing before affecting the user.

MoreoverThis setting provides a clear insight to your Magento store without mixing data from other applications.

Why use new relics with Magento 2

New relics analyze slow queries, metric servers, and traces of transactions.
Besides thatThis identifies performance barriers before they affect customers.

The special configuration of the project ensures that only your Magento store is monitored.
As a resultYou get accurate performance data and can be followed up.

Step 1: Installing the New PHP Relik Agent

To start, install the new Relic PHP agent on your server.
FirstChoose the installation method that matches your operating system.

Installation in Ubuntu/Debian

echo "deb  newrelic non-free" | sudo tee /etc/apt/sources.list.d/newrelic.list
wget -O-  | sudo apt-key add -
sudo apt-get update
sudo apt-get install newrelic-php5
sudo newrelic-install install

Installation in Centos/Rhel

sudo rpm -Uvh 
sudo yum install newrelic-php5
sudo newrelic-install install

During the installationThe installer asks you to enter your new Relic license key.
As a resultAgents activate and start monitoring your application.

Step 2: Verifying the installation

php -i | grep "newrelic"

You have to see something like this:

$ php -i | grep "newrelic"
/etc/php/8.2/cli/conf.d/20-newrelic.ini,
newrelic
newrelic.daemon.address => @newrelic
newrelic.daemon.app_connect_timeout => no value
newrelic.daemon.app_timeout => no value
newrelic.daemon.auditlog => no value
newrelic.daemon.collector_host => no value
newrelic.daemon.dont_launch => no value
newrelic.daemon.location => /usr/bin/newrelic-daemon
newrelic.daemon.logfile => /var/log/newrelic/newrelic-daemon.log
newrelic.daemon.loglevel => no value
newrelic.appname => PHP Application => PHP Application
newrelic.daemon.pidfile => no value

NextRestart PHP-FPM or Apache to apply changes:

sudo service php7.4-fpm restart
sudo service nginx restart
# OR for Apache
sudo service apache2 restart

At this stage, you can see the name of the generic application for example: “PHP Application” and APM.

HoweverThis can be adjusted to your Magento project.

Step 3: Configuring a new relic for your Magento project

Edit pub/index.php To configure a new heritage.
With this wayNew relics all requests with the name of your project.

Example code:

// Configure New Relic for this Magento application
if (extension_loaded('newrelic')) {
    newrelic_set_appname('CustomProject-Magento');
}

As a resultNew Relic only tracks your Magento project.
Because of thatData from other PHP applications is not mixed.

Newrellic-custom

The benefits of the project level configuration

Set the name of the transaction application in your store.
MoreoverThis increases performance analysis and problem solving.

In addition, combining this setting with tools such as redis for the management of the Magento 2 session further optimizes site speed.

Monitoring and insight

After being configured, enter new relics to view APM data.

You will see transactions, response time, database queries, and slow slow traces for your Magento project.

Monitoring the project level allows you to make decisions based on information to increase speed and location reliability.

Conclusion

Installing and configuring new relics for Magento 2 allows detailed application level monitoring.

Moreoverby setting the name of the application on index.phpYour store is tracked independently from other server applications.

This approach continues to monitor simple, clean, and effective.
Pairing new relics with caching solutions such as redis increases Magento scalability and performance.


News
Berita
News Flash
Blog
Technology
Sports
Sport
Football
Tips
Finance
Berita Terkini
Berita Terbaru
Berita Kekinian
News
Berita Terkini
Olahraga
Pasang Internet Myrepublic
Jasa Import China
Jasa Import Door to Door

Kiriman serupa