Advice on sending segment emails (larger ones not completing)

Looking for some insight to improve out current process. We’ve got a Wordpress plugin that compiles a daily email based on some algos, creates a new segment email on mautic. Then we’re doing a post on that email to initiate the send. (as if it were done via the UI)

I’m pretty darn sure that’s not even remotely the best way to do this …even though its worked for years. however, we have two larger campaigns where all emails do not get sent (30k each)

As you can see in the attached image …small campaign sends, larger ones do not. It’s not php.ini settings and the server is beefy. No obvious indications in any logs.

We have our own mail gateway so send speed is a non-issue as we queue on the mail server.

Can we create the email and have a cron job pick this up and send properly?

Appreciate any insight!

image

I’m sending the rest of the pending items manually …and I see its sending in batches of 100 which is why its so slow. Can I increase that batch size? There used to be email settings for that but in 5.x I think they’re gone.

Queueing is prob the answer even if our mail server doesn’t need it?

I wouldn’t be so sure about that one (don’t discard that possibility yet)

It’s not php.ini settings and the server is beefy

The described symptoms are hinting toward a web server timeout (see the web server logs)

To send emails, I would suggest to use the broadcast cmd instead of invoking it using a web server.

And to increase your sending rate, still in the mautic console, the “–limit=” is probably what you are looking for.

Good call, timeout was upstream in nginx …send was probably taking an hour. I’ve cranked it to 90 mins for now …as well as fpm.

I have had this setup forever but emails never get send on their own:
0,15,30,45 * * * * php /opt/mautic/bin/console mautic:broadcast:send > /dev/null 2>&1

“And to increase your sending rate, still in the mautic console, the “–limit=” is probably what you are looking for.”

That would be included on the broadcast:send ?

Thx for the help!

0,15,30,45 * * * * php /opt/mautic/bin/console mautic:broadcast:send --limit=200 > /dev/null 2>&1

But since you seem to need to click in order to trigger the send, I suspect that your crontab fails on the “php” part of your cmd.

Run this:
which php

And then copy and paste the result where php is.

i.e.

$ which php
/usr/local/bin/php

Then the cronjob should be like:
0,15,30,45 * * * * /usr/local/bin/php /opt/mautic/bin/console mautic:broadcast:send --limit=200 > /dev/null 2>&1

1 Like

Damn, another rookie mistake.

12,27,42,57 * * * * /usr/bin/php /opt/mautic/bin/console mautic:segment:update --batch-limit=900 >> /var/log/mautic/segment_update.log 2>&1
5,20,35,50 * * * * /usr/bin/php /opt/mautic/bin/console mautic:campaigns:update --batch-limit=100 >> /var/log/mautic/campaigns_update.log 2>&1
10,25,40,55 * * * * /usr/bin/php /opt/mautic/bin/console mautic:campaigns:trigger >> /var/log/mautic/campaigns_trigger.log 2>&1
0,15,30,45 * * * * /usr/bin/php /opt/mautic/bin/console mautic:broadcast:send --limit=250 >> /var/log/mautic/broadcast_send.log 2>&1
0 22 * * * /usr/bin/php /opt/mautic/bin/console mautic:maintenance:cleanup --days-old=180 >> /var/log/mautic/maintenance_cleanup.log 2>&1
0 23 * * * /usr/bin/php /opt/mautic/bin/console mautic:email:fetch >> /var/log/mautic/email_fetch.log 2>&1
*/4 * * * * /usr/bin/php /opt/mautic/bin/console mautic:import >> /var/log/mautic/import.log 2>&1

Added auto rotate on the logs …so we should be ready to rock. So in theory …broadcast send will send any published segment email that hasn’t been sent yet? I’ll update the php.ini for cli as well to make sure that doesn’t conk out as well.

broadcast send will send any published segment email that hasn’t been sent yet?

Exactly. You don’t even need to worry about it anymore.

It will start sending on the D-Day and suspend the sending on the last day for those who weren’t sent yet.

Thank you!

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.