我已经在我的覆盆子pi 3上安装了gitlab社区版。一切都运行正常。但是当应用程序启动时,有25个sidekiq线程。它耗尽了我的记忆,我不想要这么多线程。
我尝试通过添加文件/opt/gitlab/embedded/service/gitlab-rails/config/sidekiq.yml进行控制。
# Sample configuration file for Sidekiq.
# Options here can still be overridden by cmd line args.
# Place this file at config/sidekiq.yml and Sidekiq will
# pick it up automatically.
---
:verbose: false
:concurrency: 5
# Set timeout to 8 on Heroku, longer if you manage your own systems.
:timeout: 30
# Sidekiq will run this file through ERB when reading it so you can
# even put in dynamic logic, like a host-specific queue.
# http://www.mikeperham.com/2013/11/13/advanced-sidekiq-host-specific-queues/
:queues:
- critical
- default
- <%= `hostname`.strip %>
- low
# you can override concurrency based on environment
production:
:concurrency: 5
staging:
:concurrency: 5
我已经多次重启应用程序甚至运行“重新配置”。它没有帮助。它根本没有考虑sidekiq.yml文件。
任何人都可以告诉我哪里出错了吗?
答案 0 :(得分:1)
我通过搜索同一问题的解决方案找到了您的问题。我发现的所有东西都不起作用。所以我自己尝试了,找到了将sidekiq从25减少到5的正确位置。我使用gitlab omnibus版本。我认为这条道路对你来说是理想的:
/opt/gitlab/sv/sidekiq/run
在此文件中,您可以找到以下代码:
#!/bin/sh
cd /var/opt/gitlab/gitlab-rails/working
exec 2>&1
exec chpst -e /opt/gitlab/etc/gitlab-rails/env -P \
-U git -u git \
/opt/gitlab/embedded/bin/bundle exec sidekiq \
-C /opt/gitlab/embedded/service/gitlab-rails/config/sidekiq_queues.yml \
-e production \
-r /opt/gitlab/embedded/service/gitlab-rails \
-t 4 \
-c 25
将最后一行更改为&#34; -c 5 &#34;。结果应如下所示:
#!/bin/sh
cd /var/opt/gitlab/gitlab-rails/working
exec 2>&1
exec chpst -e /opt/gitlab/etc/gitlab-rails/env -P \
-U git -u git \
/opt/gitlab/embedded/bin/bundle exec sidekiq \
-C /opt/gitlab/embedded/service/gitlab-rails/config/sidekiq_queues.yml \
-e production \
-r /opt/gitlab/embedded/service/gitlab-rails \
-t 4 \
-c 5
最后但至少你必须重新启动gitlab服务
sudo gitlab-ctl restart
不知道,gitlab更新发生了什么。我想我必须再次改变这个值。如果gitlab开发人员将这个选项添加到/ etc / gitlab目录中的gitlab.rb,那就太好了。