Crypterion
Search…
Queue
Crypterion uses laravel queues which allows the system to defer the processing of a time consuming task, such as sending an email, until a later time. Deferring these time consuming tasks drastically speeds up web requests to your application.
You need to set up a queue worker, which execute jobs immediately they are added into the queue if a queue worker is not setup by default, we use Cron Job setup from the previous page to execute available jobs every minute.

The following steps will guide you using supervisor to setup queue worker

Root access is needed to install the supervisor application on your linux server which will ensure queue is running at all times and auto restart upon failure. To obtain Root Access for cPanel, see SSH Access (root)
Installing Supervisor
Supervisor is a process monitor for the Linux operating system, and will automatically restart your queue:work process if it fails.
To install Supervisor on Ubuntu:
1
sudo apt-get install supervisor
Copied!
To install Supervisor on CentOS:
1
sudo yum install supervisor
Copied!
Configuring Supervisor
Supervisor configuration files are typically stored in the /etc/supervisor/conf.d directory. Within this directory, you may create any number of configuration files that instruct supervisor how your processes should be monitored. For example, let's create a crypterion-worker.conf file that starts and monitors a queue:work process:
Run the follow commands one after the other:
1
cd /etc/supervisor/conf.d
2
sudo nano crypterion-worker.conf
Copied!
Copy, edit and paste the following file content:
1
[program:crypterion-worker]
2
process_name=%(program_name)s_%(process_num)02d
3
command=php /var/www/crypterion/artisan queue:work --tries=1
4
autostart=true
5
autorestart=true
6
user=oluwatosin
7
numprocs=4
8
redirect_stderr=true
Copied!
In this example, the numprocs directive will instruct Supervisor to run 8 queue:work processes and monitor all of them, automatically restarting them if they fail.
Details on the line command=php /var/www/crypterion/artisan queue:work --tries=1 is as follows:
php if you want to use a different php version from the one available in the global scope, you may use the full path to the php location instead. e.g /opt/php71/bin/php
/var/www/crypterion/artisan is the full path to the extracted content of the script. For example in cPanel it may be found in /home/<username>/crypterion/artisan according to the installation procedure where <username> is your cPanel username.
Change the line user=oluwatosin to your username. i.e user=<username>
Starting Supervisor
Once the configuration file has been created, you may update the Supervisor configuration and start the processes using the following commands:
1
sudo supervisorctl reread
2
3
sudo supervisorctl update
4
5
sudo supervisorctl start crypterion-worker:*
Copied!
Last modified 2yr ago
Copy link
Contents