Skip to content

Laravel 12 vs 8 issue #1106

@itx-ag

Description

@itx-ag

Hi,

I have a project that is in laravel 8 and php 8.1 in production.

We currently are migrating the project to laravel 12 and php 8.4 and we deployed it to the develop and staging environment and currently testing.

Our hosting provider enables the NewRelic agent when we set a env variable, and it is enable for all environments. We do not have custom code regarding NewRelic in our code. We did not change NewRelic agent configuration since this is the hosting provider configuration.

In staging and production the PHP memory is limited to 512MB, even CLI. We have an artisan command to go through our DB data and generate OpenSearch documents. This is a long running command that takes around 2 hours and is only ran manually when needed. It loop through the DB data using https://laravel.com/docs/12.x/eloquent#chunking-results and then inserts the documents in OpenSearch using bulk api (https://docs.opensearch.org/latest/api-reference/document-apis/bulk/).

What I've noticed when we upgrade the project and we run the cli command in staging, after a while it reaches the php memory limit and kills the command.

Then I ran the command with:

-d memory_limit=10000M
It finishes running the command but the php process reaches around 4.5GB.

After some debugging I ran the same command with:

-d newrelic.enabled=0
The memory does not go over 60MB indicating a problem with the new relic extension / agent.

I cannot run the same in production right now, but I ran it a few months back and we did not have the same php memory limit problem. I do remember in production that in the middle of the process I would get a warning message on the screen from NewRelic extension / agent saying that it would stop tracking (can remember the exact words). This message does not show up in staging.

In Production we have the following versions:

  • php 8.1.31
  • laravel 8
  • newrelic agent 11.4.0.17

In Staging we have the following versions:

  • php 8.4.10
  • laravel 12
  • newrelic agent 11.10.0.24

Although I can run the command without NewRelic being enabled it worries me what will happen on php cli processes we are always running like Laravel queue workers and processes that run from time to time like laravel scheduler and other cron jobs.

I see that new relic agent still does not have support for laravel 12? Could this be the problem?

Thank you,
Pedro

PS. I labeled it as a bug but don't know if it is correct label

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions