Sendy Case Study: Best Send Speed on 4GB RAM VPS with Different Settings
As the title hints, I want find out the best Sendy sending rate for a 4GB RAM VPS. The only way to do it is to try different sending rates and PHP memory limits until I find the sweet spot. I'll be using a 4GB Managed VPS for these tests. I'll be sending out a campaign each day with different settings and record the results here.
The Amazon SES account I'm testing has 360 emails per second. I'm well aware that my final sending rate won't even get close to this number. My objective is to find the best rate for my VPS, I'll look into finding best VPS for my sending rate on a later date.
Sending Rate Config: 28
PHP Memory limit: 1024 MB
Number of recipients: 60774
Time consumed: 85 minutes
Actual sending rate: ~12 per minute
The actual sending rate was less than a half the number I set in Sendy settings. Following is a screenshot of server resource usage during the execution.
The CPU peaked at 52% and overall memory usage of the server was under 25% the whole time. The bandwidth usage as follows.
I'm not sure why actual send speed was lower than the set amount when there is lots of memory to spare. Anyways I'll double the send rate setting on Sendy for the next campaign and see how that works out.
Sending Rate Config: 56
PHP Memory limit: 1024 MB
Number of recipients: 60327
Time consumed: 66 minutes
Actual sending rate: ~15 per minute
Saw a little improvement in actual send rate today. But nothing to get exited about. CPU usage increase a bit during the campaign and memory usage was almost the same as you can see from following screenshot.
Something I noticed today is that it's PHP-CLI which is processing the campaign and not PHP-FPM. This is due to the cronjob. The memory limit I set adjusted was for PHP-FPM. But it shouldn't be a problem since PHP-CLI doesn't have a limit on memory. PHP-CLI ini file contained following line.
memory_limit = -1
Which means it's unlimited. What I'm going to do next is to set the PHP-CLI memory limit to 2GB using the cronjob. To do that, I can simply modify the cronjob like this,
*/5 * * * * php -d memory_limit=2G /home/AdminUser/public_html/scheduled.php > /dev/null 2>&1
Hopefully that'll make a notable difference. And btw, I saw a little increase in bandwidth usage during this campaign.
Changes I made to the PHP-CLI memory limit had no effect what so ever. Today's campaign results are same as the last one. So I'm not posting any screenshots.
I'm going to play with PHP-FPM pool settings for the next campaign.