Is there any case against sequential cronning?

Hello all,

I have been using Mautic for a while now, but I recently began to implement sequntial cron jobs, they help my Mautic instances avoid parallel cron executions, I’m just wondering why they are not mentioned more or even just mentioned in the Documentation as the ideal Mautic cron set up?

Is there some sort of issue with using them? I see that there can be issues with 1 cron failing causing the other crons in the sequence to not run, but to me it’s better to run them sequentially and miss a few runs over the course of my mautic campaigns rather then have parallel crons stack up and cause system level bottlenecks.

1 Like

Hi,

Very interesting!

Could you give me more details about your sequential process?

How can I do this?

Regards.

Hey Jader,

You can set up sequential cron jobs by formatting your crons like this:

&& meaning each cron would run after the other completed. - Instead of having say 3 separate campaign related cron jobs you would have a single campaign cron job like the cron below which run each command “sequentially”

php /var/www/html/app/console mautic:segments:update && php /var/www/html/app/console mautic:campaigns:update --batch-limit=75 && php /var/www/html/app/console mautic:campaigns:trigger --batch-limit=75 &&

I like to set up Mautic Cron Jobs with a Nodejs app called Crontab-ui, it allows me to easily manage cron’s via a Gui and to test crons with a click of a run button. Feel free to check out a simple tutorial over it here: https://github.com/AdMigo/Mautic-Crontab-ui-tutorial

1 Like

This is very interesting, however I am not sure I fully understand what affect this has.

I have an issue where we are running a very big instance of Mautic with over 600K active users, with thousands of active users per minute, over 50 orders per minute and over 100 segments and multiple campaigns running.

We have noticed that on some big campaigns, where for example we are sending out 500K+ push notifications, 300K+ sms and emails as well, things do not get fired off properly. If I go in an fire off a campaign with -I and the campaign id, then it fires, however if I just leave normal cronjob running certain campaigns are not fired off. Would the above fix this problem ?

@mikew This is a large instance, you need to multi-thread somehow.

Thanks @joeyk - any direction on where to start learning / implementing ?

I dropped you a mail about segments which I solved already, but it’s a diff. topic. I have something in mind, where you could make 5 groups with ID ranges for each campaign with equivalent number of contacts it them, then fire the campaign accordingly. But this includes some shell script, that reads the DB and creates the cron scripts dynamically.
I will work on it in the near future for sure.
My shell scrips are only a bandaid, Mautic should be able to manage this natively, but I’m not there yet to create such a high level customization.

1 Like