Install and configure supervisord on centos 7 to run Laravel queues permanently

here is how to install and config supervisord on centos 7 to run Laravel queues permanently: easy_install supervisor yum install supervisor vim /etc/supervisord.conf edit section program as following: [program:laravel-worker] command=php /path/to/app.com/artisan queue:work process_name=%(program_name)s_%(process_num)02d numprocs=8 priority=999 autostart=true autorestart=true startsecs=1 startretries=3 user=apache redirect_stderr=true stdout_logfile=/path/to/log/worker.log systemctl enable supervisord to autorun at start systemctl restart supervisord to restart the … Read more

Supervisorctl not respecting my configuration

You should run supervisorctl with -c as well. From the documentation (my emphasis): The Supervisor configuration file is conventionally named supervisord.conf. It is used by both supervisord and supervisorctl. If either application is started without the -c option (the option which is used to tell the application the configuration filename explicitly), the application will look … Read more

Starting supervisord as root or not?

Supervisord switches to UNIX user account before any processing. You need to specify what kind of user account it should use, run the daemon as root but specify user in the config file Example: [program:myprogram] command=gunicorn –worker-class socketio.sgunicorn.GeventSocketIOWorker app.wsgi:application -b 127.0.0.1:8000 directory=/opt/myprogram user=user1 autostart=true autorestart=true redirect_stderr=True Visit http://supervisord.org/configuration.html#program-x-section-values for more information

Your server socket listen backlog is limited to 100 connections

Note that a “listen backlog” of 100 connections doesn’t mean that your server can only handle 100 simultaneous (or total) connections – this is instead dependent on the number of configured processes or threads. The listen backlog is a socket setting telling the kernel how to limit the number of outstanding (as yet unaccapted) connections … Read more

Supervising virtualenv django app via supervisor

The documentation for the virtualenv activate script says that it only modifies the PATH environment variable, in which case you can do: [program:diasporamas] command=/var/www/django/bin/gunicorn_django directory=/var/www/django/django_test environment=PATH=”/var/www/django/bin” … Since version 3.2 you can use variable expansion to preserve the existing PATH too: [program:diasporamas] command=/var/www/django/bin/gunicorn_django directory=/var/www/django/django_test environment=PATH=”/var/www/django/bin:%(ENV_PATH)s” …