Come impostare il limite di velocità di invio delle email?

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 Mi Piace

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 Mi Piace

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 Mi Piace

What are you using to send email?

I use AWS SES service

1 Mi Piace

Have you raised with their support?

1 Mi Piace

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 Mi Piace

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 Mi Piace

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.

2 Mi Piace

Ciao Josh!

Per i riassunti, puoi limitare questo valore a 14 al secondo impostando questa variabile globale di Discourse a 420, come mostrato di seguito nel tuo file di build del container:

 DISCOURSE_MAX_DIGESTS_ENQUEUED_PER_30_MINS_PER_SITE: 420

Questo non è “esattamente” ciò che desideri, ma è molto vicino.

Poiché 14 al secondo (come da tuo messaggio) moltiplicati per 30 secondi fanno 420, questa impostazione globale limiterà i riassunti a circa 420 ogni 30 minuti, proprio come “dice” il codice:

Vedi anche:

Naturalmente, se il tuo canale SMTP sta inviando altre email, dovrai ridurre questo valore; oppure puoi configurare un canale diverso e separato per le email dei riassunti (come facciamo noi).

Nota: Questa impostazione globale è impostata di default a 10.000 ogni 30 minuti; che è un bel po’ di riassunti all’ora, se vuoi il mio parere ;). Quindi, noi l’abbiamo impostata molto più bassa per avere un “ragionevole” conto SendGrid ogni mese.

30 riassunti ogni 30 minuti = 1.440 al giorno, o circa 43.200 al mese (perché prima di apportare questa modifica qualche giorno fa stavamo inviando molti riassunti). Il mese prossimo, alzerò questo valore a circa 60 riassunti ogni 30 minuti, ovvero circa 86.400 riassunti al mese, più o meno.

Spero che questo ti sia d’aiuto.

3 Mi Piace