Jump to content

BULK_MAILS_PER_CYCLE Not working as expected.


TDBF
Go to solution Solved by Stuart Silvester,

Recommended Posts

I have set the constant BULK_MAILS_PER_CYCLE to 100, however bulk emails are still being sent out at 400 a time.

\define( 'BULK_MAILS_PER_CYCLE', 100 );

Thus my emails are getting temporarily deferred due to unexpected volume.

Is this correct or am I missing something here? ๐Ÿ™‚

Link to comment
Share on other sites

  • Solution
1 hour ago, TDBF said:

I have set the constant BULK_MAILS_PER_CYCLE to 100, however bulk emails are still being sent out at 400 a time.

\define( 'BULK_MAILS_PER_CYCLE', 100 );

Thus my emails are getting temporarily deferred due to unexpected volume.

Is this correct or am I missing something here? ๐Ÿ™‚

This constant doesn't affect the speed at which emails are sent, only the amount that are processed 'per cycle' and background tasks are designed to run as many cycles as possible in within the allowed server resources.

There isn't a way to restrict how many emails are sent per time, perhaps you may want to look at a service such as SendGrid or SES that can handle the volume.

Link to comment
Share on other sites

2 hours ago, Stuart Silvester said:

This constant doesn't affect the speed at which emails are sent, only the amount that are processed 'per cycle' and background tasks are designed to run as many cycles as possible in within the allowed server resources.

There isn't a way to restrict how many emails are sent per time, perhaps you may want to look at a service such as SendGrid or SES that can handle the volume.

Thanks for the info.

There was only 700+ emails being sent out in total, shame you couldn't put a time on each cycle ๐Ÿ˜‰

I have already been looking into SendGrind, but it's not really worth it as we only do bulk emails once every blue moon.

Thanks.

Link to comment
Share on other sites

  • 2 years later...
On 9/29/2021 at 11:53 PM, Stuart Silvester said:

background tasks are designed to run as many cycles as possible in within the allowed server resources

How is that calculated? I too would like to get a better understanding of how the cycle variable would typically affect the time distributions of the mails. At least roughly.ย 

Link to comment
Share on other sites

By default, it's 90 seconds. Then it looks at theย max_execution_time PHP configuration and will then use that instead, if it's less than 90 seconds.

Then it looks at wait_timeout in MySQL and if it's less than max_execution_time, it uses that instead.

Then, it looks at the memory_limit PHP configuration and if it's not unlimited, it takes that into account.

Then it will run the task as many times as it can until one of the following happens (in this order):

  1. The task indicates it has nothing else to do.
  2. If the task is explicitly told to run X amount of times, it will stop when it reaches that amount.
  3. If it gets close enough to the timeout that it cannot run another cycle.
  4. If it gets close enough to the memory limit that it cannot run another cycle.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
ร—
ร—
  • Create New...