Skip to content

Insufficient memory creates unlogged 60 second delays. Increasing memory resolves it. #1535

Open
@RyanPaiva56

Description

@RyanPaiva56

Horizon Version

5.30.2

Laravel Version

11.41.3

PHP Version

8.4.3

Redis Driver

PhpRedis

Redis Version

2.3

Database Driver & Version

No response

Description

This is 100% reproducible. I'm using Laravel 11 Sail using horzion/redis. If you use the default horizon.php config settings, eventually, your queue will just start getting funky in the following ways:

  1. All queued jobs will take exactly 1 minute before the next job starts.
  2. Chained job busses will only run the first job.

For instance, if i queue up 1000 jobs that take 10ms each, each job will complete and show in horizon as being "done" successfully and having taken 10ms. Then horizon will just sit there for exactly 1 minute and then run the next job, which will work perfectly, then wait again.

If you then increase your memory from the default 64 to 256, the queue will instantly go back to working properly. This took me wayyyy too long to figure out.

I also checked through the code here on GH for horizon and didn't see anything that would create the delay.

Steps To Reproduce

  1. Use Laravel sail.
  2. Leave the default memory limit in place in horizon.php.
  3. Queue up a bunch of stuff.
  4. Queue will begin to only work 1 minute at a time.
  5. Increase your memory limit and the queue will go back to being fast again.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions