Understanding email delivery settings and how they impact performance

Understanding email delivery settings and how they impact performance

Since there seems to be a huge misunderstanding related to how delivery settings should look like, I think a good explanation is needed.
Let’s look at this:

Screenshot 2016-02-24 12.24.36

So, we have 10 campaigns at once and 100 subscribers at once.
What does that mean is that when the cron job will run, that is, each minute, it will load from the database 10 campaigns that are ready for sending and sequentially, for each campaign, will load 100 subscribers, send 100 emails for first one, then pick the next campaign and load 100 subscribers and so on till the 10th campaign is done.
Keep in mind that for each email that is processed, there is a certain memory usage which depends on the size of the template used in the campaign, on the number of custom fields for the list used in campaigns and various other factors, like the in memory cached list field definitions and so on.

Now, remember how I said that each minute the cron job runs and picks up campaigns for sending?
If we look at the below settings:

Screenshot 2016-02-24 12.37.02

And imagine that at minute 1 the cron job runs and picks up the campaigns and starts sending 1000 emails for first campaign (rest of them still wait for sending).
While the first campaign is still processing, the cron job at minute 2 also runs, and starts sending for the second campaign, that is 1000 more subscribers to process, and we go on till cron job number 10, which processes 1000 subscribers at once. So we end up processing around 10k subscribers at some point because we loaded a high number of subscribers for each campaign and that campaign didn’t finish sending while other campaigns started sending.
Now, this should become very obvious on the number of issues it can create on a slow server(or slow smtp server), that’s why you should be really careful at these settings, it’s not just how much memory usage a single cron run does, but it’s also about the number of the cron jobs that end up running at same time.

Next, if we enable PCNTL sending, say like:

Means that when the cron job runs, it will process 5 campaigns at once.
For each campaign, it will load 5 batches of 1000 subscribers.
Doing a quick math, 5 campaigns * 5 batches of subscribers * 1000 subscribers = 25000 subscribers at once. Now take memory usage into consideration for 25k subscribers at once and take network connections into consideration and also take in consideration when next cron runs and starts doing 25k subscribers at once again if the first cron didn’t finish yet and so on.
Bottom line is that you should really take into consideration all the above.
Don’t set high values if you don’t know what they do.

    • Related Articles

    • Delivery settings

      By default, AppMail uses delivery settings that will be fine for most people. However, if you need, you can properly adjust them in order to get a higher delivery speed. Please be aware that wrong delivery settings can cause a lot of issues, ...
    • Performance improvements

      Here are a few things you can do to improve the performance of your AppMail app: 1. Make sure you have plenty RAM/CPU on your server. Really, you cannot expect to send million emails from your 4GB RAM vps and the server to remain snappy forever. 2. ...
    • Why do I get the error “This email address cannot be used” while saving a delivery server settings?

      Starting with version 1.9.23, the email address that you use in the "FROM" field of a delivery server must be unique across all the customers in the system. What this means exactly, if you have a customer A that uses a delivery server which has a ...
    • Delivery Servers Warmup Plans

      Starting with the version 2.1.10 we added the delivery servers Warmup Plans feature, which was long requested by our customers. Some background on the "Warming Process" Delivery server warming is the gradual process of establishing a reputation as a ...
    • Why do I get this error - email delivery is temporary disabled?

      The error "Email delivery is temporary disabled." is specific to the following situations: 1. You have no active delivery server. 2. You have one/more active delivery servers, but they are over the hourly quota 3. You have a valid delivery server, ...