# Posts in rapid succession do not send all emails

**URL:** https://meta.discourse.org/t/posts-in-rapid-succession-do-not-send-all-emails/194946
**Category:** Support
**Created:** [June 24, 2021, 10:06pm UTC](https://meta.discourse.org/t/posts-in-rapid-succession-do-not-send-all-emails/194946 "2021-06-24T22:06:51Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [June 24, 2021, 10:06pm UTC](https://meta.discourse.org/t/posts-in-rapid-succession-do-not-send-all-emails/194946/1 "2021-06-24T22:06:51Z")

</div>

This forum must approve all posts. As a result some posts are published in rapid succession: when a moderator logs in they approve the posts quickly after each other.

Most categories are set to “watching” for all users and almost no users log in, the forum is relying very heavily on email notifications.

The problem is that whenever posts are published in rapid succession (less than 1.5 minutes apart), not all emails are being sent. This query shows the count of all sent emails (entries in `email_logs` per topic). The amount of users that should be getting an email is around 2250. When people have logged in recently (about 1%) they don’t get an email, so the number varies a bit but should be between 2200 and 2250.

As you can see in the first three lines, posts published quickly after each other do not have the full amount of emails.

What could be going on here?

Oh, `max_emails_per_day_per_user` is set to something really high.

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/a/aa731a762383816f76f549e3fe721fe11d4e5a07.png)  
columns: topic, date/time, category, # emails sent

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [November 29, 2021, 7:45am UTC](https://meta.discourse.org/t/posts-in-rapid-succession-do-not-send-all-emails/194946/2 "2021-11-29T07:45:24Z")

</div>

In the past months we had some new insights:

- the problem was not with the actual emails, but with the generation of the underlying notificiations
- generating many notifications in quick succession leads to Sidekiq restarting with `Sidekiq is consuming too much memory`
- Sidekiq restarting leads to the current batch of notifications that is being generated for a post, being **aborted** , resulting in an incomplete set of notifications.

EDIT raising `UNICORN_SIDEKIQ_MAX_RSS` has prevented this issue from happening again in the past 9 days.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [December 29, 2021, 7:46am UTC](https://meta.discourse.org/t/posts-in-rapid-succession-do-not-send-all-emails/194946/3 "2021-12-29T07:46:01Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
