E-mail Send Rate in phplist

From Lunarpages Web Hosting Wiki
Jump to: navigation, search

If you are on a shared host, it will probably be appreciated if you don't send out loads of emails in one go. To do this, you can configure batch processing using a script called PHPList. It is available under both Fantastico and LPCP Softaculous or it can be installed manually. Please note, the following two values can be overridden by your ISP by using a server wide configuration. So if you notice these values to be different in reality, that may be the case.

Define the amount of emails you want to send per period. If 0, batch processing is disabled and messages are sent out as fast as possible. (This is not recommended on our servers) Also note, these changes need to be made to the config.php file for phplist.

define <http://www.php.net/define>("MAILQUEUE_BATCH_SIZE",0);

Define the length of one batch processing period, in seconds (3600 is an hour):

define <http://www.php.net/define>("MAILQUEUE_BATCH_PERIOD",3600);

To avoid overloading the server that sends your email, you can add a little delay between messages that will spread the load of sending you will need to find a good value for your own server value is in seconds (or you can play with the autothrottle below):

define <http://www.php.net/define>('MAILQUEUE_THROTTLE',0);

The number 0 is what needs to be changed. Also please remember that Lunarpages currently have a limit of 20 per min which should be advised to throttle also. Please see example code block below

Limiting the speed rate

At full speed phplist (up to version 2.10.5) will send about 3000 personalized messages per hour, or about 5000 non-personalized messages per hour. Given that most shared hosting providers will not allow that message volume to be sent and will impose an hourly or daily limit, Phplist offers two methods to deal with these message limits: /mailqueue batch/ processing and /mailqueue throttle/ processing. The choice in using batches or throttling is basically a personal preference, although throttling may be better suited for servers running PHP-cgi (see the three interfaces of PHP at http://docs.phplist.com/PhpInterfacesInfo).

Mailqueue batch processing

With batch processing, two primary settings work together to say: Send no more than N emails every T seconds. Where:

N is MAILQUEUE_BATCH_SIZE T is MAILQUEUE_BATCH_PERIOD

These settings force phplist to "restrain itself" and avoid sending out all messages in one go.

So, say you have an hourly limit of 400 emails. Should you set the batch size to 300? No! Why?

What about other emails, such as confirmation requests, system messages, or emails sent by other applications you might have running on this site?

No, you want to back away from that "300", which is a best case scenario. Instead give yourself some safe breathing room. For example, if you get 24 new sign-ups a day then you should subtract 5 or so to be safe, thus 295. Running other software that sends notifications? back it down. A comfortable number for a small installation would be 20-40 down from your hourly limit.

Example:

Send a batch of 360 messages per batch period:

define <http://www.php.net/define>("MAILQUEUE_BATCH_SIZE",360);

batch period is set to 3600 seconds (=1 hour):

define <http://www.php.net/define>("MAILQUEUE_BATCH_PERIOD",3600);

Pause between messages (in seconds) to avoid overloading the server:

define <http://www.php.net/define>('MAILQUEUE_THROTTLE',1);

For further reading of this issue please visit http://docs.phplist.com/PhpListConfigSendRate

Share |
Want to read this in another language?