Thursday, March 30, 2017

Laravel 5.4.16 Homestead - supervisor terminating itself suddenly

Since updating my homestead today I've been having problems with supervisor queues (using Redis). The problem I am facing is that my queues terminate themselves after about 60 seconds (with some alternation).

This problem hasn't occured before updating to the most recent homestead version and I just can't figure out why this is happening, there are no logs or errors shown about this and my colleague is having the same problem.

My memory is only using ~1000MB RAM, which is way under my allowed 4GB limit, so that can't be the problem. Running the script using PHP itself works perfectly aswell, it's just supervisor that is giving the problems.

I have tried to change to the database variant of the queue driver and it causes the same situation to happen (plus it's slower than supervisor). Using the sync driver does make it stay alive, but it's 10 times as slow and I want Redis to handle the queues for me.

My supervisor configuration looks like this:

; supervisor config file

[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0700                       ; sockef file mode (default 0700)

[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor            ; ('AUTO' child log dir, default $TEMP)

; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a unix socket

; The [include] section can just contain the "files" setting.  This
; setting can list multiple files (separated by whitespace or
; newlines).  It can also contain wildcards.  The filenames are
; interpreted as relative to this file.  Included files *cannot*
; include files themselves.

[include]
files = /etc/supervisor/conf.d/*.conf

My project specific configuration looks like this:

[program:grotesmurf_laravel_queue]
process_name=%(program_name)s_%(process_num)02d
command=php /home/vagrant/Code/grotesmurf/artisan queue:work --sleep=3 --tries=3 --queue=grotesmurf --timeout=0
autostart=true
autorestart=true
user=vagrant
numprocs=3
redirect_stderr=true
stdout_logfile=/home/vagrant/Code/grotesmurf/storage/logs/queue/laravel_queue.out.log
stderr_logfile=/home/vagrant/Code/grotesmurf/storage/logs/queue/laravel_queue.err.log

My php-fpm log is not outputting anything.

My supervisord queue is not outputting anything.

My laravel.log is not outputting anything.

My supervisor version: 3.3.1

My php version is : 7.1.3-3+deb.sury.org~xenial+1

My laravel version is: 5.4.16

If any more information is needed, please let me know.

Does anyone have any suggestions for things to try? Is anyone else experiencing this issue aswell?

Thanks in advance.



via Kakkeroth

Advertisement