Mautic crashes when sending 35k emails

Your software
My Mautic version is: 4.4.12
My PHP version is: 7.4.33
My Database type and version is: MariaDB-0ubuntu0.24.04.1 - Ubuntu 24.04

Your problem
My problem is:

These errors are showing in the log:
using AWS ses I’m using 33 threads to send 50k emails, when 39k arrives Mautic doesn’t send but it gets stuck if I restart and reconfigure cron it sends the rest normally. Follow the configuration I’m using

0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-1 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-2 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-3 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-4 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-5 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-6 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-7 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-8 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-9 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-10 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-11 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-12 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-13 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-14 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-15 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-16 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-17 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-18 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-19 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-20 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-21 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-22 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-23 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-24 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-25 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-26 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-27 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-28 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-29 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-30 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-31 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-32 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=10 --lock-name=envio-mv-33 --lock_mode=flock > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=1 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=2 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=3 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=4 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=5 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=6 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=7 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=8 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=9 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=10 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=11 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=12 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=13 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=14 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=15 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=16 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=17 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=18 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=19 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=20 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=21 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=22 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=23 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=24 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=25 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=26 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=27 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1	
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=28 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=29 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=30 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=31 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=32 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1
0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=33 --thread-id=33 --batch=1 --limit=1 > /var/log/cron.pipe 2>&1

Steps I have tried to fix the problem:

Hi, you are sending full power for 10 seconds every half an hour. This is only useful if you are trying to emulte a pulsar on the night sky.

First of all, in order to take advantage of file locks, you need to watch this video:

Otherwise just use this cron task:

* * * * * /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=50

Once. Not many times.
This will send emails for 50 seconds continously.
If you want to send faster, chcek the video.

1 Like

I currently have 130k leads in mautic and a limit of 150 per second in aws ses, could you help me configure the lines below?

I currently have 130k leads in mautic and a limit of 150 per second in aws ses, could you help me configure the lines below?

How many threads would be needed?

If you were to send 150 per second how would you do it?

0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:emails:send --time-limit=50 --lock-name=envio-mv-1 --lock_mode=flock > /var/log/cron.pipe 2>&1

0,30 * * * *  /usr/local/bin/php /var/www/html/bin/console mautic:broadcasts:send --max-threads=79 --thread-id=1 --batch=10 --limit=10 > /var/log/cron.pipe 2>&1

Why do you want to send so fast? If you send 100k emails in 5 min, can your server process 30k email opens and 10k click redirects?
You can ddos yourself.

I need to send 150k in 20 minutes, in 50 seconds I can send 300, what would be the best way to configure the crons?

If you are using Mautic 4, then you need a multi thread option. Did you install the elements I mentioned in the video?

Yes, I just haven’t been able to find a confirmation yet. As I explained, I have 150k emails and I can send 300 per second, what configuration is necessary to send them in 20 minutes? Can you describe it to me?

I do literally describe this in the video above.