summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQingyu Zhao <qzhao@gitlab.com>2019-09-04 21:44:43 +1000
committerQingyu Zhao <qzhao@gitlab.com>2019-09-11 01:04:25 +1000
commitd01feec31a997d8d21195535734408b1ae4b8fc0 (patch)
tree208e6eb92e29b1f92c2cc60eecabb49b96bc2298
parent797848c0c8ab7fafd0712f52aee33053b34ae551 (diff)
downloadgitlab-ce-add-sidekiq-options-memory-growth-kb.tar.gz
Add sidekiq_options memory_killer_memory_growth_kbadd-sidekiq-options-memory-growth-kb
-rw-r--r--app/workers/gitlab/github_import/stage/finish_import_worker.rb2
-rw-r--r--app/workers/gitlab/github_import/stage/import_repository_worker.rb2
-rw-r--r--app/workers/repository_import_worker.rb6
3 files changed, 10 insertions, 0 deletions
diff --git a/app/workers/gitlab/github_import/stage/finish_import_worker.rb b/app/workers/gitlab/github_import/stage/finish_import_worker.rb
index a779e631516..91ec2d9e779 100644
--- a/app/workers/gitlab/github_import/stage/finish_import_worker.rb
+++ b/app/workers/gitlab/github_import/stage/finish_import_worker.rb
@@ -8,6 +8,8 @@ module Gitlab
include GithubImport::Queue
include StageMethods
+ sidekiq_options memory_killer_memory_growth_kb: 50, memory_killer_max_memory_growth_kb: 200_000
+
# project - An instance of Project.
def import(_, project)
project.after_import
diff --git a/app/workers/gitlab/github_import/stage/import_repository_worker.rb b/app/workers/gitlab/github_import/stage/import_repository_worker.rb
index 4d16cef1130..09ed41c437d 100644
--- a/app/workers/gitlab/github_import/stage/import_repository_worker.rb
+++ b/app/workers/gitlab/github_import/stage/import_repository_worker.rb
@@ -8,6 +8,8 @@ module Gitlab
include GithubImport::Queue
include StageMethods
+ sidekiq_options memory_killer_memory_growth_kb: 50, memory_killer_max_memory_growth_kb: 300_000
+
# client - An instance of Gitlab::GithubImport::Client.
# project - An instance of Project.
def import(client, project)
diff --git a/app/workers/repository_import_worker.rb b/app/workers/repository_import_worker.rb
index dff9c8f50bf..861ea5bf896 100644
--- a/app/workers/repository_import_worker.rb
+++ b/app/workers/repository_import_worker.rb
@@ -6,6 +6,12 @@ class RepositoryImportWorker
include ProjectStartImport
include ProjectImportOptions
+ # Whitelist this job from Gitlab::SidekiqDaemon::MemoryKiller
+ # [TODO] statistic the better value. Maybe staging server is a good test environment?
+ # The value 50 means: contribute 50K rss increase per second. This is estimated from: 15M RSS increase when import running for 300 seconds.
+ sidekiq_options memory_killer_memory_growth_kb: 50, memory_killer_max_memory_growth_kb: 300_000
+
+
def perform(project_id)
@project = Project.find(project_id)