メール送信速度の制限を設定する方法は?

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.

Unsubscribe_keys

email_log

「いいね!」 2

You need to get a faster mail server and/or change settings so that let mail gets sent.

You can change how often summary emails get sent and change the max emails per day setting.

There is no rate limit setting.

「いいね!」 1

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.

「いいね!」 2

What are you using to send email?

I use AWS SES service

「いいね!」 1

Have you raised with their support?

「いいね!」 1

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.

「いいね!」 8

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

「いいね!」 2

解決策は見つかりましたか?Amazon SES に切り替えようとしたところ、初期制限が秒間 14 通であることを知りました。Discourse が SES にどれくらいの速さでメールを送信するかは不明です。このサイトでは大量のメールが送信されます。

Discourse が送信するメールの最大レートをご存知の方はいらっしゃいますか?1 秒間に 14 通を超える送信を試みるでしょうか?

もし送信が速すぎるとすれば、すべてのユーザーのダイジェスト送信時間を週にわたって均等に分散させ、ある 1 日(当サイトのインポート記念日)に大量に送信するのではなく、スクリプトを作成するのが良いアイデアかもしれません。

編集: これが問題かどうかを判断するために、Mandrill のログを確認すればよいことに気づきました。Mandrill による追加のスロットリングがなければ、最大で約 8 通/秒の制限があると思うので、問題ないはずです。

「いいね!」 2

こんにちは、Josh さん!

ダイジェストメールについては、コンテナビルドファイルで以下の Discourse グローバル設定を 420 にすることで、1 秒あたり 14 通に制限できます。

DISCOURSE_MAX_DIGESTS_ENQUEUED_PER_30_MINS_PER_SITE: 420

これは「完全に」ご希望の通りではありませんが、非常に近い値です。

ご投稿にある「1 秒あたり 14 通」を 30 秒で割ると 420 になるため、このグローバル設定により、ダイジェストメールは約 30 分あたり 420 通に制限されます(コードの記述通りです)。

参考リンク:

もちろん、SMTP チャネルで他のメールも送信している場合は、この値を下げる必要があります。あるいは、ダイジェストメール専用の別のチャネルを設定することも可能です(私たちが行っているように)。

注:このグローバル設定のデフォルト値は 30 分あたり 10,000 通に設定されています。私の感覚では、これは 1 時間あたりのダイジェスト数が非常に多すぎます。そのため、毎月の SendGrid の請求額を「妥当」な範囲に抑えるため、この値を大幅に下げて設定しています。

30 分あたり 30 通のダイジェストは、1 日で 1,440 通、1 ヶ月で約 43,200 通になります(数日前にこの変更を加える前は、ダイジェストを非常に多く送信していました)。来月には、これを 30 分あたり約 60 通、つまり 1 ヶ月で約 86,400 通前後に引き上げる予定です。

参考になれば幸いです。

「いいね!」 3