In a support thread titled ‘How to set Email sending speed limit?’, lisbethw1130 reports slow email sending speeds (20/sec) on their Discourse forum, noting a large discrepancy between unsubscribe_keys (500,000 records/day) and mail_log (9,000 records). They suspect high sending rates may cause issues and seek to throttle speed, but find no built-in rate limit. pfaffman suggests improving the mail server or adjusting digest frequency and max daily emails. lisbethw1130 questions whether throttling is necessary even at 60/sec due to potential blocking. Stephen and codinghorror ask for details on email volume and purpose; lisbethw1130 explains a past activity led to 90,000 new users, now receiving digest emails. j127 raises similar concerns about Amazon SES’s 14/sec limit and whether Discourse exceeds it; they later check Mandrill logs and find ~8/sec. neounix provides a workaround: set DISCOURSE_MAX_DIGESTS_ENQUEUED_PER_30_MINS_PER_SITE: 420 to limit digests to ~14/sec (420 per 30 mins), noting default is 10,000 per 30 mins. They advise adjusting further if other emails share the channel or using a separate channel for digests to control costs.
I have a forum on discourse but with slow sending speed limit (20/sec)
Am I able to set sending speed limit on discourse?
I’m asking this because I found that I got nearly 500,000 records everyday on unsubscribe_keys table, but only 9000 in mail_log and 1000 in skipped_mail_log, our forum have nearly 500,000 members, too.
I’m not sure whether it’s caused by sending email too fast and make some weird problem happened, so I’m trying to throttle the sending speed but with no luck.
not sure whether sending rate is necessary…
because even we can increase to probably 60/sec,it’s still possible that the server send too fast and get blocked.
Why are so many Discourse members being mailed? What are they being mailed for, exactly? That’s the more relevant question.
On a typical Discourse install, the only “all users” email is the digest, and even that is specific to only users who have not been on the website in a week or more, but also haven’t been gone more than a year.
In general you only get emails when someone is speaking directly to you, and even then only when you haven’t touched the website with any web browser in the last 10 minutes.
We had an activity before. (about several months ago) That activity attracted about 90 thousand members registered. And now they may leave for a few weeks. So system sent them the digest emails
Did you ever find a solution? I’m about to switch to Amazon SES and just realized that our initial limit is 14 emails per second. I’m not sure how quickly Discourse is going to send them into SES. The site sends a lot of email.
Does anyone know the maximum rate that Discourse sends emails? Will it try to send more than 14 per second?
If it sends too quickly, I’m wondering if it might be a good idea to write a script that evenly spaces the digest sending times for all the users across the week instead of sending the bulk of them on one day (our import anniversary).
Edit: I realized that I could figure out if this is a problem by checking the Mandrill logs. Unless I’m looking at some extra throttling from Mandrill, I think we have a maximum of about 8 emails per second, so it should be fine.
This is not “exactly” what you want but it is darn close.
Since 14 per second (from your post) times 30 seconds = 420, this global setting will limit digests to around 420 per every 30 minutes, just like the code “says”:
See also:
Naturally, if your SMTP channel is sending other emails, you will need to adjust this down; or you can set up a different, separate channel for digest emails (like we do).
Note: This global setting is set to 10,000 per 30 minutes by default; which is a lot of digests per hour if you ask me ;). So, we set this much lower so we have a “reasonable” SendGrid bill each month.
30 digests per 30 minutes = 1440 per day, or around 43,200 per month (because we were sending a lot of digests before I made this change a few days ago). Next month, I will bump this up to around 60 digests per 30 minutes, or around 86,400 digests per month plus or minus.