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.
Disable code level metrics.
Disable logging.
Set
newrelic.transaction_tracer.max_segments_web
andnewrelic.transaction_tracer.max_segments_cli
>= 1.Set
newrelic.transaction_tracer.detail
= 0.Set
newrelic.transaction_tracer.enabled
= false.Increase the transaction tracer threshold by setting
newrelic.transaction_tracer.threshold
= higher value.Set
newrelic.transaction_tracer.explain_enabled
= false.Don't trace slow SQL statements by setting
newrelic.transaction_tracer.slow_sql
= 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. Fargate is affected by clocksource and is known to cause additional overhead.