SMTP too slow with AWS SES

Posted September 17, 2014 6.9k views

I am having trouble understanding this problem.

I have two boxes (ec2, droplet) and same exact code. I sent an email from both using AWS SES SMTP settings and both send emails as expected.
But on droplet, it takes about 3-5 seconds for it send and on ec2 is near instantaneous.

Note, I am talking about delivery of the email to the inbox but just sending the email from the server (issuing the SMTP request)

Can someone shed some light on this?


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

It’s likely that when on EC2 your requests stays inside Amazon’s internal network while on DigitalOcean it simply needs to go further. The first thing I’d check to debug this is a traceroute to the SMTP endpoint from both the EC2 instance and the DigitalOcean droplet.

I’ve also heard anecdotal evidence that using the SES API rather than directly using their SMTP interface will result in better speeds, especially when sending mass emails.

  • You’re spot on. I should have ran traceroute before I posted this question.
    Its horrendous when attempting to do it from droplet than from ec2 instance. I might have to switch email provider or SES API.

    On a side note, I raised this issue before. When I attempt to connect to my droplet via SSH it takes a long time. This impacts our builds because fabric uses ssh to deploy code.