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:
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
:
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:
(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:
[1] pry(main)> Sidekiq.paused?
=> false
And when I start it manually, it works:
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:
- How do I get it to create
/shared/log/rails/sidekiq.log
? - 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!