2016-08-19 106 views
0

我已經在我的樹莓派3上安裝了gitlab社區版。一切工作正常。但是當應用程序啓動時,有25個sidekiq線程。它消耗了我的記憶,我不想要那麼多線程。sidekiq.yml文件沒有考慮

我試着通過添加文件/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文件。

任何人都可以讓我知道我要去哪裏嗎?

回答

1

我發現你的問題是通過搜索相同問題的解決方案。我找到的所有東西都不起作用。所以我自己嘗試了一下,並找到了將sidekiq從25減少到5的正確位置。我使用gitlab綜合版本。我認爲路徑是idetical到你:

/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 

最後但並非最不重要YOUT必須resart gitlab服務

sudo gitlab-ctl restart 

不知道,在gitlab更新了什麼事情。我想我必須再次改變這個值。如果gitlab開發人員將此選項添加到/ etc/gitlab目錄中的gitlab.rb中,那將會很不錯。