How to Use New Relic for Monitoring Magento 2 Performance

Why Monitoring Magento 2 Performance Matters

Running a Magento 2 store without performance monitoring is like driving blindfolded—you won’t see bottlenecks until they hit you. Slow page loads, checkout delays, or server crashes can tank your sales and SEO rankings. That’s where New Relic comes in. It’s a powerful tool that gives you real-time insights into your store’s performance, from server health to slow database queries.

In this guide, we’ll walk through setting up New Relic for Magento 2, interpreting key metrics, and fixing common issues. Whether you’re on Magefine’s hosting or self-managed, these steps will help you optimize your store.

Setting Up New Relic for Magento 2

First, you’ll need a New Relic account (sign up here). They offer a free tier with enough features for small stores. Once registered:

  1. Install the New Relic agent on your server. For Linux, run:
    sudo curl -L https://download.newrelic.com/php_agent/release/newrelic-php5-10.10.0.310-linux.tar.gz | tar -xz  
    cd newrelic-php5-10.10.0.310-linux  
    sudo ./newrelic-install install
  2. Configure the agent by editing /etc/php/7.x/fpm/conf.d/newrelic.ini (replace 7.x with your PHP version). Set your license key and app name:
    newrelic.license = "YOUR_LICENSE_KEY"  
    newrelic.appname = "Magento 2 Store"
  3. Restart PHP-FPM:
    sudo service php7.x-fpm restart

Key Metrics to Watch in New Relic

Once installed, New Relic tracks:

  • Apdex Score: Measures user satisfaction (aim for >0.9).
  • Response Time: Ideally under 1s for pages, 200ms for APIs.
  • Throughput: Requests per minute—spikes may need scaling.
  • Error Rates: Fix anything above 0.5%.
  • Database Queries: Slow queries? Optimize indexes.

Example: Diagnosing a Slow Checkout

Say your checkout takes 5+ seconds. In New Relic:

  1. Go to Transactions > Key Transactions.
  2. Select checkout/cart/index.
  3. Check the Trace Details tab. You might see a slow third-party payment module or unoptimized SQL.

Pro Tips for Magento 2

  • Exclude admin traffic via newrelic.ignored_params = "admin" in your INI file.
  • Use New Relic’s Synthetics to monitor critical paths (e.g., add-to-cart).
  • Integrate with Slack/email for outage alerts.

New Relic turns guesswork into actionable fixes. Pair it with Magefine’s performance extensions (like Full Page Cache Warmer) for even faster stores.

Got questions? Drop them below or reach out to our team!