Notifications
Clear all

Sendy Case Study: Best Send Speed on 4GB RAM VPS with Different Settings

16 Posts
2 Users
2 Likes
64 Views
Tharindu
(@tharindu)
Reputable Member Admin
Joined: 10 years ago
Posts: 307
Topic starter  

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.


   
Quote
Tharindu
(@tharindu)
Reputable Member Admin
Joined: 10 years ago
Posts: 307
Topic starter  

Update #01

Sending Rate Config: 28
PHP Memory limit: 1024 MB
Number of recipients: 60774
Time consumed: 85 minutes
Actual sending rate: ~12 per second

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.

 


   
ReplyQuote
Tharindu
(@tharindu)
Reputable Member Admin
Joined: 10 years ago
Posts: 307
Topic starter  

Update #02

Sending Rate Config: 56
PHP Memory limit: 1024 MB
Number of recipients: 60327
Time consumed: 66 minutes
Actual sending rate: ~15 per second

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.


   
ReplyQuote
Tharindu
(@tharindu)
Reputable Member Admin
Joined: 10 years ago
Posts: 307
Topic starter  

Update #03

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.

 


   
ReplyQuote
(@Anonymous 806)
Active Member
Joined: 5 years ago
Posts: 7
 

New to the forum and site. I love everything you post so far. Eagerly awaiting your continued results here.

On my own setup, I've given PHP 4GB in memory_limit and am still only yielding about 11-12/sec. I'll be tweaking my settings very soon, as well.

This post was modified 5 years ago 2 times by Anonymous

   
ReplyQuote
Tharindu
(@tharindu)
Reputable Member Admin
Joined: 10 years ago
Posts: 307
Topic starter  

Hi @underthegun,

Welcome to the forum. I've had a busy couple of weeks here. I'll be testing again and posting an update to this next week. Stay tuned.

And feel free to post your results as well ? .


   
ReplyQuote
(@Anonymous 806)
Active Member
Joined: 5 years ago
Posts: 7
 

Will do @Tharindu and thank you for the welcome! I just made some tweaks tonight, got a campaign going out in the morning.

Here are the settings I'll be testing... tell me what you think:

max_execution_time = 300
max_input_time = 300
max_input_vars = 4000
memory_limit = 8192M
post_max_size = 50M
session.gc_maxlifetime = 3440
session.save_path = "/var/cpanel/php/sessions/ea-php71"
upload_max_filesize = 50M
zlib.output_compression = Off
This post was modified 5 years ago by Anonymous

   
Tharindu reacted
ReplyQuote
Tharindu
(@tharindu)
Reputable Member Admin
Joined: 10 years ago
Posts: 307
Topic starter  

Looks good. I see you have increased the memory limit. It's interesting to see if it makes a difference. But from the test I did, it didn't make a difference. I noticed that PHP wan't utilizing the allocated memory.


   
ReplyQuote
(@Anonymous 806)
Active Member
Joined: 5 years ago
Posts: 7
 
Posted by: Tharindu

Looks good. I see you have increased the memory limit. It's interesting to see if it makes a difference. But from the test I did, it didn't make a difference. I noticed that PHP wan't utilizing the allocated memory.

Yeah plus the timing and what not. So far I really can't seem to top 11-12/second. These changes I tried didn't work. I got a few other tweaks in mind but I'm wondering if it's the hardware or even the bits-per-second.


   
ReplyQuote
(@Anonymous 806)
Active Member
Joined: 5 years ago
Posts: 7
 

I know on the Sendy forums a huge agreement is putting it on an Amazon EC2 in the same region as your SES. Maybe that's the answer?


   
ReplyQuote
Tharindu
(@tharindu)
Reputable Member Admin
Joined: 10 years ago
Posts: 307
Topic starter  
Posted by: underthegun

I know on the Sendy forums a huge agreement is putting it on an Amazon EC2 in the same region as your SES. Maybe that's the answer?

I was following that discussion too. It's weird as Ben suggested to use Amazon Linux AMI for better performance. There was another topic comparing EC2 Ubuntu machine and Ec2 Amazon Linux machine. The EC2 Amazon Linux machine seems to have better performance.

What's bugging me is that my servers doesn't even go near resource limits. I tested and DigitalOcean upload speed reached 60Mbps for a file transfer between EC2 instance and DigitalOcean droplet. Yet Sendy uploads barely reach 10Mbps. And all other resources are underutilized.


   
ReplyQuote
(@Anonymous 806)
Active Member
Joined: 5 years ago
Posts: 7
 
Posted by: Tharindu
Posted by: underthegun

I know on the Sendy forums a huge agreement is putting it on an Amazon EC2 in the same region as your SES. Maybe that's the answer?

I was following that discussion too. It's weird as Ben suggested to use Amazon Linux AMI for better performance. There was another topic comparing EC2 Ubuntu machine and Ec2 Amazon Linux machine. The EC2 Amazon Linux machine seems to have better performance.

What's bugging me is that my servers doesn't even go near resource limits. I tested and DigitalOcean upload speed reached 60Mbps for a file transfer between EC2 instance and DigitalOcean droplet. Yet Sendy uploads barely reach 10Mbps. And all other resources are underutilized.

This is exactly why I'm here. I don't know if they have a good answer or not and at least you're trying and posting your results!

My server load might get to 1, memory usage basically stays the same. I've even trimmed down my email templates.

I'm beginning to wonder if the speed SES gives you is like "you can send text-only emails at 80/second"


   
ReplyQuote
(@Anonymous 806)
Active Member
Joined: 5 years ago
Posts: 7
 

I'm starting to think the issue is in mySQL... it doesn't seem to matter how much more power I give PHP, it's not really going beyond 10-15/sec.

Thoughts?


   
ReplyQuote
Tharindu
(@tharindu)
Reputable Member Admin
Joined: 10 years ago
Posts: 307
Topic starter  
Posted by: @underthegun

I'm starting to think the issue is in mySQL... it doesn't seem to matter how much more power I give PHP, it's not really going beyond 10-15/sec.

Thoughts?

Yes, this might be the case. I've been trying to optimize MySQL (I have MariaDB btw) using MySQL Tuner lately. I'm not putting much effort to increasing the send rate because my client is happy with the current rate.

Last time I checked, the actual rate was 16/sec. I have it set to 40/sec in Sendy settings. I need to measure the actual rate again. I've been applying MySQL Tuner recommendations for a couple weeks now. But don't know if it improved the speed.


   
ReplyQuote
(@Anonymous 806)
Active Member
Joined: 5 years ago
Posts: 7
 

Bummer. I wish you knew!! Lol well I increased packet size, memory, all sorts of stuff in mysql. I guess I'll see soon!


   
Tharindu reacted
ReplyQuote
Page 1 / 2
Share:
Back to top button