# Very slow Sidekiq issue with large queue due to massive numbers of unread user notifications

**URL:** <https://meta.discourse.org/t/very-slow-sidekiq-issue-with-large-queue-due-to-massive-numbers-of-unread-user-notifications/140716>\
**Category:** Self-hosting\
**Created:** [February 5, 2020, 12:07pm UTC](https://meta.discourse.org/t/very-slow-sidekiq-issue-with-large-queue-due-to-massive-numbers-of-unread-user-notifications/140716 "2020-02-05T12:07:57Z")\
**Posts on this page:** 1\
**Showing post:** 70

<div class="post-metadata">

**Author:** ![eatcodetravel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eatcodetravel/32/94385_2.png) [@eatcodetravel](https://meta.discourse.org/u/eatcodetravel)\
**Post date:** [February 26, 2020, 8:07pm UTC](https://meta.discourse.org/t/very-slow-sidekiq-issue-with-large-queue-due-to-massive-numbers-of-unread-user-notifications/140716/70 "2020-02-26T20:07:48Z")

</div>

I just want to add that doing a `VACUUM FULL VERBOSE <big table>` and `REINDEX DATABASE <db_name>` worked for us to speed up our requests. Index size dropped and our renders are fast again.

### before

```plaintext
table_name | row_estimate | table_size | index_size | total_size
--------------------------------------------------------------------------
post_uploads | 52450 | 619 MB | 1255 MB | 1873 MB
post_custom_fields | 513 | 1246 MB | 9096 kB | 1254 MB
posts | 9969 | 256 MB | 13 MB | 269 MB
uploads | 45818 | 92 MB | 88 MB | 179 MB
stylesheet_cache | 1807 | 122 MB | 296 kB | 123 MB

```

### after

```plaintext
table_name | row_estimate | table_size | index_size | total_size
--------------------------------------------------------------------------
post_custom_fields | 5482 | 1238 MB | 1072 kB | 1239 MB
post_uploads | 52483 | 622 MB | 12 MB | 635 MB
posts | 9969 | 128 MB | 2424 kB | 130 MB
stylesheet_cache | 1839 | 122 MB | 232 kB | 122 MB
uploads | 52305 | 92 MB | 30 MB | 122 MB

```

### request performance

 ![image](https://global.discourse-cdn.com/meta/original/3X/6/9/6906f1e1efaebd4fccc83df6a1f92689eb0c2973.png)

Not sure if this has to do with the rebakes since we did a lot of these lately by enabling some settings and doing migrations.

Thanks!

---

_[View the full topic](https://meta.discourse.org/t/very-slow-sidekiq-issue-with-large-queue-due-to-massive-numbers-of-unread-user-notifications/140716)._
