Problem
The New Relic PHP agent was previously reporting data but then stopped reporting. In addition:
- When you checked your agent daemon log file
/var/log/newrelic/newrelic-daemon.log
, you saw the messageLack of activity within 10ms
. - The health status for the application is grey.
- The option to delete the application appears in the application's Settings menu when you select the icon.
Solution
Use either of these methods to keep your application from entering an idle state:
- Set the timeout value for
newrelic.daemon.app_timeout
to at least twice the interval of your transactions. For example, for an hourly background job, set the timeout to two hours. - Recommendation: If you have long or infrequent processes, run a cron job every five minutes with a simple transaction, such as
phpinfo()
. This will help ensure the application does not enter an idle state.
重要
Do not set newrelic_ignore_transaction
to ignore the cron job. The PHP agent will enter an idle state if the job does not run and report.
Cause
If an application's transactions take longer than ten minutes, or occur less frequently than once every ten minutes, the application enters and remains in an idle state.
When the PHP agent is in an idle state, two transactions must occur before it will start reporting again:
- The first transaction wakes up the daemon and re-establishes the connection to New Relic.
- The second transaction reports data to New Relic.