I am using Mautic 4.2 and Amazon SES which has currently 14/sec max. send rate. However, I am not being able to send more than 7/sec of emails using queue. I have to be ready for future which might need about 300/sec.
I have checked that infrastructure is not a problem as I cant see spikes on CPU or Memory or Network etc in Mautic server
I am using cron jobs to send emails but to test emails/sec I directly run command in console as below
a. Firstly I populate queue in spool using campaign rebuild and trigger
b. Count total no. of emails in queue say 1000
c. Run command to send email say 800 per minute
/bin/php /var/www/html/mautic/bin/console mautic:emails:send --time-limit=60 --message-limit=800
d. Count total no. of remaining emails in queue and it is around 500 to 550
So that is the problem there, I was expecting Mautic to complete 800 per min as in command but something is wrong there. Can you please help me with this problem?
Also I tried to run same command with diff. locks which exceeds max send rate, However, it does not reach 800 per min anyway.
Your server is too slow. You’d need to investigate the bottle neck. (DB, memory, CPU?)
At the same time I would be cautions with sending so fast. If you exceed the limit, you lose emails.
Server CPU /memory showing OK values when you run HTOP doesn’t mean that you fully utilize it. You need to tweak your DB and PHP settings in a way to speed up send.
Mautic 5 will speed up email sending by 3,5x. I’s wait for that couple of months.
@joeyk , Thanks for your suggestion, I tried this and ended with duplicates again. Then I investigated a little bit and I found that when using multi threading, some threads collide with each other and they give some warning that there is no file *.sending and thus results in failed message.
These failed messages are then picked up again as configured in system. So, I configured not to retry failed message and wipe them out. Then there are no duplicates now. I know that this is not 100% accurate solution as there might be true failure sometimes that we want system to resend again.
Anyways, I am still surprised at why multithreading is not working as expected even though I have added lock_mode=flock.
Using the above code, we benchmarked some email tests. This code runs 3 send commands at the same time, which is about 18 emails per second to our SMTP sever… which is too fast. We’re going to only run 2, or about 12.5 emails per second.