Net::SMTPServerBusy causes Sidekiq to DOS instances and take down site

Recently we moved to Amazon SES and forgot to get a rate limit increase for talk.jekyllrb.com, before noticing that we forgot to get this increase we ended up being DOS’d by Discourse because of Net::SMTPServerBusy rate limiting and Discourse checking and queing thousands of emails over and over again which resulted in a consumption of 100% CPU (which ultimately got fixed temporarily by us doing a CPU limit on the Sidekiq PiD’s from outside of Docker.)

It would be great if Discourse could handle Net::SMTPServerBusy and try again in an hour (rather than seconds – which in the grand scheme of thousands of emails is over and over again.) This way it can try again with a clean slate and if there could be an option for users to set the maximum emails per second that their server is willing to accept so that Discourse can throttle itself and divvy up it’s Sidekiq queues by that limit.

3 Likes

Sure @zogstrip can you look into this?

2 Likes

Just added support for Net::SMTPServerBusy :e-mail:

https://github.com/discourse/discourse/commit/d224966a0ed6d1bb10e6c9a7b4c787c495e81b49

5 Likes

This topic was automatically closed after 3 days. New replies are no longer allowed.