How to make triggering campaigns faster?

Hi there,

It takes about 10 seconds to complete triggering campaigns which has 1000 emails in default it is processing 100 per batch
mautic:campaigns:trigger

I want to make it faster because in production there will be lots of emails to be triggered so I tried using max-threads=5 and batch-limit=500
But this is not working and taking same amount of time as before
mautic:campaigns:trigger --max-threads=10 --batch-limit=1000

Can you please help?

Hi,
It sounds like your problem is with Email sending part of the campaigns, right?

@joeyk here, I want to speed up the triggering of campaigns so that it can put a lot of emails in queue in a minute. How is this possible? Any idea?

I was able to send 100 emails per second with 27 threads running concurrently however trigger campaign should match sends as that will put emails in queue. I tried using max thread option with trigger, but it’s not working

What do you mean by not working?
How fast you wanna send?

If you want to so fast I think you should look for another software. Its hurting you more then helping.

If you use the campaign action to send email rather then segment email - you will end up in blacklist since Mautic doesnt apply unsub header for campign emails

In order to really understand how to speed up your Mautic sending and what the pitfalls are, check these videos:

  1. The 1 minute cronjob
  1. What should you send? Transactional or segment emails?
  1. This is how emil sending works (queue explained)

Thank you very much @joeyk. Very helpful videos to understand Mautic, really good work there.

I am also using queue as per your advice for huge emails and I have cron job for email sending which is working great as I have used multiple threads and email sending from queue is pretty fast.

Now I also need to speed cron job of campaign triggers. But problem is I dont know how to use multi-threading here. Can you give some examples how we can use maxthread argument for cron job of campaign trigger?

Example when I use two commands simultaneously for cron job campaign trigger, the second one gives error as below

Below are two commands I am using
mautic:campaigns:trigger --thread-id=2 --max-threads=5
&
mautic:campaigns:trigger --thread-id=1 --max-threads=5

Many thanks

You can separate the contacts by ID. minID and maxID.
How many contacts you have?

@joeyk there are 10k contacts as of now and soon going to be 30-40k

I tried following but gives error that other process is running

mautic:campaigns:trigger --min-contact-id=1 --max-contact-id=400 & mautic:campaigns:trigger --min-contact-id=405 --max-contact-id=900