# Sidekiq stops after some time

**URL:** <https://meta.discourse.org/t/sidekiq-stops-after-some-time/267777>\
**Category:** Self-hosting\
**Created:** [June 9, 2023, 9:54am UTC](https://meta.discourse.org/t/sidekiq-stops-after-some-time/267777 "2023-06-09T09:54:22Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![bizotto](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bizotto/32/303257_2.png) [@bizotto](https://meta.discourse.org/u/bizotto)\
**Post date:** [June 9, 2023, 9:54am UTC](https://meta.discourse.org/t/sidekiq-stops-after-some-time/267777/1 "2023-06-09T09:54:23Z")

</div>

Hello all,

I have an installation with 3 Openshift deployments, one for Redis (7.0.10), one for Postgress (13.10) and another for discourse (stable 3.0.3), everything works fine when deployed, however, after a couple of hours or days, sidekiq processes (UNICORN\_SIDEKIQS=3) stop, there are some things that I noticed, under `/shared/log/rails`, there is no `sidekiq.log` being generated, and I believe that brings me to the reason why sidekiq does not restart automatically:

````plaintext
root@discourse-b9f766dcf-52zjq:/var/www/discourse# ls -laF /shared/log/rails/
total 32
drwxr-xr-x. 2 nobody www-data 4096 Jun 9 08:57 ./
drwxr-xr-x. 3 root root 4096 May 30 06:16 ../
-rw-r--r--. 1 nobody www-data 16082 Jun 9 09:28 production.log
-rw-r--r--. 1 nobody www-data 1345 Jun 9 09:02 unicorn.stderr.log
-rw-r--r--. 1 nobody www-data 204 Jun 9 09:02 unicorn.stdout.log```

````

When `sidekiq` stops I see the following message in the `host/logs`:

```plaintext
Info:
Sidekiq is consuming too much memory (using: 530.35M) for 'discourse.internal.odencluster.com', restarting

backtrace:
config/unicorn.conf.rb:163:in `check_sidekiq_heartbeat'
config/unicorn.conf.rb:243:in `master_sleep'
unicorn-6.1.0/lib/unicorn/http_server.rb:295:in `join'
unicorn-6.1.0/bin/unicorn:128:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/3.2.0/bin/unicorn:25:in `load'
/var/www/discourse/vendor/bundle/ruby/3.2.0/bin/unicorn:25:in `<main>'

```

Then I can see in the discourse pod log the message:

```plaintext
(48) Reopening logs
(48) Reopening logs
(48) Reopening logs

```

However, since there is no `sidekiq.log` under `/shared/log/rails/`, it does not restart.

My rails knowledge is close to zero, therefore I find it difficult troubleshooting it, but I see that sidekiq is not paused:

```plaintext
[1] pry(main)> Sidekiq.paused?
=> false

```

And when I start it manually, it works:

```plaintext
2023-06-09T09:47:15.556Z pid=195386 tid=449q INFO: Booting Sidekiq 6.5.8 with Sidekiq::RedisConnection::RedisAdapter options {:host=>"redis", :port=>6379, :namespace=>"sidekiq"}
2023-06-09T09:47:20.528Z pid=195386 tid=449q INFO: Booted Rails 7.0.4.3 application in production environment
2023-06-09T09:47:20.528Z pid=195386 tid=449q INFO: Running in ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
2023-06-09T09:47:20.528Z pid=195386 tid=449q INFO: See LICENSE and the LGPL-3.0 for licensing details.
2023-06-09T09:47:20.528Z pid=195386 tid=449q INFO: Upgrade to Sidekiq Pro for more features and support: https://sidekiq.org

```

There are a couple of thinks that I imagine would help me solve this issue:

1. How do I get it to create `/shared/log/rails/sidekiq.log`?
2. How do I get to allow sidekiq to use more than 530M of memory?

If someone would have a suggestion, please let me know and I thank you in advance to take your time supporting this!

Have a great one! 🙂

---

_[View the full topic](https://meta.discourse.org/t/sidekiq-stops-after-some-time/267777)._
