Comment utiliser New Relic pour surveiller les performances de Magento 2
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, paiement delays, or server crashes can tank your sales and SEO rankings. That’s where New Relic comes in. It’s a powerful tool that vous donne real-time insights into your store’s performance, from server health to slow database queries.
Dans ce guide, nous’ll walk through setting up New Relic for Magento 2, interpreting clé metrics, and correctifing common problèmes. Whether you’re on Magefine’s hosting or self-managed, these étapes will help you optimize your store.
Setting Up New Relic for Magento 2
Premièrement, you’ll need a New Relic account (sign up here). They offer a free tier with enough fonctionnalités for small stores. Une fois registered:
- 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 - Configure the agent by editing
/etc/php/7.x/fpm/conf.d/newrelic.ini(replace7.xwith your PHP version). Set your license clé and app name:newrelic.license = "YOUR_LICENSE_KEY" newrelic.appname = "Magento 2 Store" - Restart PHP-FPM:
sudo service php7.x-fpm restart
Key Metrics to Watch in New Relic
Une fois installed, New Relic tracks:
- Apdex Score: Measures utilisateur 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 paiement takes 5+ seconds. In New Relic:
- Go to Transactions > Key Transactions.
- Select
paiement/cart/index. - Check the Trace Details tab. You might see a slow tiers payment module or unoptimized SQL.
Conseils de pro for Magento 2
- Exclude admin traffic via
newrelic.ignored_params = "admin"in your INI fichier. - Use New Relic’s Synthetics to monitor critical paths (e.g., add-to-cart).
- Integrate with Slack/e-mail for outage alerts.
New Relic turns guesswork into actionable correctifes. 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!