【问题标题】:sidekiq.yml file is not being considered未考虑 sidekiq.yml 文件
【发布时间】:2016-08-19 10:17:08
【问题描述】:

我已经在我的树莓派 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文件。

谁能告诉我哪里出错了?

【问题讨论】:

    标签: gitlab raspberry-pi2 raspberry-pi3


    【解决方案1】:

    我通过搜索相同问题的解决方案找到了您的问题。我发现的一切都不起作用。所以我自己尝试了再见,找到了将sidekiq从25减少到5的合适位置。我使用gitlab综合版本。我认为这条路对你来说是理想的:

    /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
    

    将最后一行更改为“-c 5”。结果应如下所示:

    #!/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 中,那就太好了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-12-25
      • 2019-04-13
      • 1970-01-01
      • 1970-01-01
      • 2023-01-03
      • 1970-01-01
      • 1970-01-01
      • 2021-06-16
      相关资源
      最近更新 更多