---
title: PHP agent overhead reduction tips
source: https://docs.newrelic.com/docs/apm/agents/php-agent/troubleshooting/agent-overhead-reduction-tips
---

## Problem

Using the New Relic PHP agent results in overhead. Performance overhead is anything that increases latency, CPU, or memory usage beyond what what would exist without the agent.

## Cause

Overhead is an expected side effect of monitoring and reporting on software. Our engineers aim to minimize this, but your experience may differ quite a lot, depending on how you're using the agent. If you find that you're experiencing unexpected overhead, there are are various settings in the `INI` that can help reduce it.

## Solution

Performance INI settings that can reduce overhead depending on your agent usage.

1.  Reduce [`newrelic.span_events.max_samples_stored`](https://docs.newrelic.com/docs/apm/agents/php-agent/configuration/php-agent-configuration/#inivar-span-events-max-samples-stored).

2.  Disable [code level metrics](https://docs.newrelic.com/docs/apm/agents/php-agent/configuration/php-agent-configuration/#inivar-code-level-metrics).

3.  Disable [logging](https://docs.newrelic.com/docs/apm/agents/php-agent/configuration/php-agent-configuration/#log-forwarding).

4.  Set [`newrelic.transaction_tracer.max_segments_web`](https://docs.newrelic.com/docs/apm/agents/php-agent/configuration/php-agent-configuration/#inivar-tt-maxsegweb) and [`newrelic.transaction_tracer.max_segments_cli`](https://docs.newrelic.com/docs/apm/agents/php-agent/configuration/php-agent-configuration/#inivar-tt-maxsegcli) >= 1.

5.  Set [`newrelic.transaction_tracer.detail`](https://docs.newrelic.com/docs/apm/agents/php-agent/configuration/php-agent-configuration/#inivar-tt-detail) = 0.

6.  Set [`newrelic.transaction_tracer.enabled`](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration#inivar-tt-enabled) = false.

7.  Increase the [transaction tracer threshold](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration#inivar-tt-threshold) by setting `newrelic.transaction_tracer.threshold` = higher value.

8.  Set [`newrelic.transaction_tracer.explain_enabled`](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration#inivar-tt-explain-enabled) = false.

9.  Don't trace slow SQL statements by setting [`newrelic.transaction_tracer.slow_sql`](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration#inivar-tt-slowsql) = false.

## Other overhead considerations

A non-performant clocksource can affect the agent which checks the time for every span. Please ensure you're using an appropriate [clocksource](https://support.newrelic.com/s/hubtopic/aAX8W0000008a7rWAA/relic-solution-php-agent-cpu-overhead-tips).
Fargate is affected by clocksource and is known to cause additional [overhead](https://docs.newrelic.com/docs/apm/agents/php-agent/troubleshooting/fargate-nitro-clock-performance-impact/).
