mailing queue without cron?
Your setup
- What version of Cachet? 2.3
- What database driver? MySQL? Postgres? SQLite? MySQL
- What version of PHP? 7
I was wondering if there was a way to have the mail queue functionality without having to make a cron job? As I'm currently running Cachet as an app on a PaaS, it's not practical for me to edit the crontab every time the app is rescheduled anywhere.
Would you have suggestions there? Or should I just stick with the sync driver (which works well, but I have only one user so I don't really know how it scales)?
+1 Can we execute the mailing queue as a daemon?
I observed some issue while multiple jobs are created in the database (on creating incidents) but the delivery of mail is delayed (probably because of queue executing slowly in case of multiple jobs). I'm looking into this further.
Is there alternative for running the mailing queue better which is not listed here in the docs - https://docs.cachethq.io/docs/setup-subscribers
Yes, you can. Just use a queue worker. :)
That is infact the preferable way to do it. We only have the cron there to make things simpler if you don't want to setup a queue worker.
https://laravel.com/docs/5.2/queues#running-the-queue-listener
@GrahamCampbell Thanks. This would be a useful thing to add in the docs.
It does not really solve my problem unfortunately (as far as I can tell) as I can't really run that as part of my paas-deployed cachet (kind of like with a heroku php buildpack). I guess it makes a case for a Docker deployment (as there is no other way to run this in our environment on a physical server / full fledged VM).
Can we execute the mailing queue as a daemon?
Yes. :)
It does not really solve my problem unfortunately
If you are not able to run a queue worker, then your only other option is to set the queue to sync.
I can't run something else than a webserver on a single container in that context, I would prefer if there was a possibility to send async http requests to an external mailing component with the mail content, but I understand this is not much a priority for Cachet.
if I ever get to do that I'll send a PR if you want to have a look. :)
In general, it would be great to have more modern methods to deploy production grade Cachet rather than manual install on servers.
I hope you guys could have added more details and shed light on the best practice to run a queue worker for handling subscription mailing for Cachet in your docs. Will try to implement this https://laravel.com/docs/5.2/queues#running-the-queue-listener (Queue Listener) and see if it improves mail delivery.
Alternate question, how many requests can be handled if queue driver is set to sync and what is the possibility of losing out sending out mails in such a scenario? Is implementing a queue worker the best and most efficient practice for this?
@GrahamCampbell For starters, a simple guide on how to use beanstalkd or sqs instead of database as QUEUE_DRIVER with cachet will be helpful. Hope you could provide more support on this.
Just use the laravel docs. It's identical.