Set up a new relic for the Magento 2 project


It configures a new relic for the Magento 2 project to efficiently control the shop performance.

ThereforeYou can track all applications, optimize transactions and avoid slowdown before users affect.

AlsoThis configuration provides a clear view of your Magento warehouse without mixing data from other applications.

Why use a new relic with Magento 2

New analysis of slow relics, server metrics and traces of transactions.
AlsoIdentify performance bottlenecks before customers affect.

The specific project settings guarantees that only your Magento store is controlled.
As a resultGet accurate and actable performance data.

Step 1: Installation of the new Relic Agent PHP

To begin with, install the new Relic PHP agent on your server.
FormerSelect the installation method that matches your operating system.

Installation at 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 hundreds/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.
ConsequenceAgent activates and start controlling your application.

Step 2: Verify installation

php -i | grep "newrelic"

You should 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

NextReboot 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 may see a generic application name, for example: “PHP App” and APM.

Howevercan be customized for your Magento project.

Step 3: Configuration of new relics for your Magento project

Edit pub/index.php To set up a new relic.
This wayNew groups of relics all applications for your project’s name.

Example code:

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

As a resultNew Relic Track only your Magento project.
ThereforeData from other PHP applications do not mix.

Newrelic-Custom

Benefits of Settings at Project Level

Settings of the app name covers transactions in your store.
AlsoImproves performance analysis and problem solving.

In addition, combine this configuration with tools such as Redis for Magento 2 sessions management further optimizes the speed of the site.

Supervision and information

Once configured, sign in to new relics to see APM data.

You will see transactions, response time, database consultations and specific traces specific to your Magento project.

Project control allows you to make informed decisions to improve the speed and reliability of the site.

Conclusion

The installation and configuration of new relics for Magento 2 allows detailed tracking at the applications level.

Alsosetting up the app name to index.phpYour store is tracked independent of other server applications.

This approach keeps track of simple, clean and effective.
Combine new relics with cache solutions such as Redis improves scalability and magento performance.



Technology

Berita Olahraga

Lowongan Kerja

Berita Terkini

Berita Terbaru

Berita Teknologi

Seputar Teknologi

Berita Politik

Resep Masakan

Pendidikan

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post