Skip to content
Advertisement

Laravel 5.7 – Queues Jobs are too slow

I use Laravel 5.7 and 3 queues jobs, the time between jobs is too long/slow.

I foreach items of RSS feeds in the first job, and I dispatch this item in second job, etc… I don’t enter in details but there are some ridiculous little calculations that must not take time.

The problem is that every dispatch to a job takes a lot of time. Horizon and Telescope do not allow me to debug.

The machine I use has 32 GB of RAM, and there are several processes (15 each) that turn the tails.

[program:mywebsite_feeder]
command=/RunCloud/Packages/php72rc/bin/php artisan queue:work redis --queue=feeder --tries=3 --sleep=0
directory=/home/runcloud/webapps/mywebsite
redirect_stderr=true
autostart=true
autorestart=true
user=runcloud
numprocs=15
process_name=%(program_name)s_%(process_num)s

I have this error in laravel.log:

production.ERROR: AppJobsFeederJob has been attempted too many times or run too long. The job may have previously timed out.

Advertisement

Answer

I had the same issue and did a lot of searches but nothing help, even there is some issues about this bug in horizon Github but without a useful solution. the problem is about horizon and Redis bug for heavy tasks.

finally, I switch from Redis and horizon to SQL database (whatever you use in your project for me mssql) as queue connection and it fixed the problem

notice: use --timeout=0 in your artisan command

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement