[PHP] Extremely slow performance with New Relic on PHP CLI procedure (>10 hours vs 5 minutes)

Hello everybody,
we are new to newrelic one. We have some php7.4 cron procedures running from CLI on Debian 11.
One of these procedures reads 90.000 rows from a CSV file with the fgetcsv command and it saves each line into Mysql8. This takes usually up to 5 minutes. Since we have installed newrelic-php, the same procedure takes more than 10 hours to complete. The crons overlap and we had to disable the newrelic module in order to avoid problems to our infrastructure.
It sounds like al lots of transactions make newrelic unsuitable for our use case.
We wonder if we can do something with the configuration in order to speed this procedures up and keep the module active for php profiling. If no tuning is possible we have to opt out from newrelic one service.
Thank you in advance for your kind support. Any tip is welcome.

Hi @programmatori

Welcome to our ExplorersHub!!

I’m wondering if the PHP Agent is trying to instrument this 90K loop (I believe that it is a loop) in a single transaction or if a new transaction is being created for each iteration of this loop?

So, there are a few things to try:

Please let me know if you are still having this issue and I’ll be happy to investigate further.