I have to run a laravel command php artisan queue:work --daemon
to run jobs stored on Beanstalkd queues.
I have come across two possible solutions:
Register a command in the config files of Supervisord and start it.
*/1 * * * * /usr/bin/php /var/www/laravelProj/artisan queue:work --daemon --tries=3
Can someone please explain what way should I go and what would be the best for performance enhancement.
Cron allows you to create your own chains manually. Scheduler allows you to place resource control (CPU limits, undo tablespace limits, etc) against your job. It allows you to define classes with priorities and assign jobs to those classes.
Crontabs are the configuration files used by Cron to run services. Crontabs hold the configurations for which service to run and when it should run. Services are nothing more than an execution path to a script or application with possible additional commands. Cronjobs are the individual entries in that Crontab file.
Using a cron job to hit a web page to trigger application processes is not heavy. It is a bit of a long winded approach but the act of fetching the page itelf ( wget etc) is not heavy. The heaviness of your application process is another matter entirely of course.
By Florian Leibert, Harry Shoff, & Andy Kramolisch. Chronos is our replacement for cron. It is a distributed and fault-tolerant scheduler which runs on top of Mesos. It's a framework and supports custom mesos executors as well as the default command executor.
There is one main advantage of Supervisor that the task you set there is working constantly. This mean that when the proces will finish the new one will starts immediately.
Crontab runs every process for a minutue minimum! So if you have a task like queue:work
is much better to use Supervisor over Crontab.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With