Closed bramley closed 12 months ago
When DOMAIN_AUTO_THROTTLE is enabled, running_throttle_delay is adjusted when needed. The main objective is to spread the sending of DOMAIN_BATCH_SIZE over the total period of DOMAIN_BATCH_PERIOD, instead of sending DOMAIN_BATCH_SIZE in the first few seconds.
The PR diff is a bit hard to read and see the consequences of.
Can we not just add "&& $succces" to
and
That would probably have the same effect. Maybe then move this whole chunk
if (isset($running_throttle_delay)) {
sleep($running_throttle_delay);
if ($counters['sent'] % 5 == 0) {
// retry running faster after some more messages, to see if that helps
unset($running_throttle_delay);
}
} elseif (MAILQUEUE_THROTTLE) {
usleep(MAILQUEUE_THROTTLE * 1000000);
...
}
usleep($delay * 1000000);
}
}
to be within this near line 1173, if it should be run only when the sending was successful and not when throttled or sending was unsuccessful.
if ($success) {
Yes, that makes more sense. Do you want to update the PR to do that?
Yes, I will revise the pull request.
Now added another commit that moves the delay processing.
It's a bit hard to test this, but I think it looks fine, so approving.
This pull request has been mentioned on phpList Discuss. There might be relevant details there:
https://discuss.phplist.org/t/3-6-14-release-candidate-ready-for-testing/9109/1
This pull request has been mentioned on phpList Discuss. There might be relevant details there:
https://discuss.phplist.org/t/phplist-3-6-14-released-security-release/9158/1
Description
When using domain throttling, if sending to an email address is rejected because the limit on its domain has been reached and an email was not sent, the delay of
MAILQUEUE_THROTTLE
is still applied. This seems unnecessary and slows down the sending rate.The first commit is to apply
MAILQUEUE_THROTTLE
andMAILQUEUE_AUTOTHROTTLE
only when the domain was not throttled. I don't fully understand the$running_throttle_delay
processing so have left that as it is.The second commit is to simplify the initialisation of the
$domainthrottle
array into one place, when a new domain is met or a new interval is started for an existing domain.Related Issue
Screenshots (if appropriate):