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

**URL:** https://meta.discourse.org/t/net-smtpserverbusy-causes-sidekiq-to-dos-instances-and-take-down-site/43849
**Category:** Bug
**Created:** [7 mei 2016 om 15:27 UTC](https://meta.discourse.org/t/net-smtpserverbusy-causes-sidekiq-to-dos-instances-and-take-down-site/43849 "2016-05-07T15:27:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![envygeeks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/envygeeks/32/115860_2.png) [@envygeeks](https://meta.discourse.org/u/envygeeks)
#### Post date: [7 mei 2016 om 15:27 UTC](https://meta.discourse.org/t/net-smtpserverbusy-causes-sidekiq-to-dos-instances-and-take-down-site/43849/1 "2016-05-07T15:27:56Z")

</div>

Recently we moved to Amazon SES and forgot to get a rate limit increase for [talk.jekyllrb.com](http://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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [7 mei 2016 om 15:37 UTC](https://meta.discourse.org/t/net-smtpserverbusy-causes-sidekiq-to-dos-instances-and-take-down-site/43849/2 "2016-05-07T15:37:53Z")

</div>

Sure @zogstrip can you look into this?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [9 mei 2016 om 19:54 UTC](https://meta.discourse.org/t/net-smtpserverbusy-causes-sidekiq-to-dos-instances-and-take-down-site/43849/3 "2016-05-09T19:54:53Z")

</div>

Just added support for `Net::SMTPServerBusy` 📧

[https://github.com/discourse/discourse/commit/d224966a0ed6d1bb10e6c9a7b4c787c495e81b49](https://github.com/discourse/discourse/commit/d224966a0ed6d1bb10e6c9a7b4c787c495e81b49)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [12 mei 2016 om 19:58 UTC](https://meta.discourse.org/t/net-smtpserverbusy-causes-sidekiq-to-dos-instances-and-take-down-site/43849/4 "2016-05-12T19:58:07Z")

</div>

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