Howto set SIDEKIQ_MEMORY_KILLER_MAX_RSS?

I need to export a large project. The export fails with:

WARN: current RSS 1545636 exceeds maximum RSS 1000000

So I want to increase SIDEKIQ_MEMORY_KILLER_MAX_RSS according to the documentation
But how would I do this (CE 10.1.4 omnibus)?
Tried in /lib/systemd/system/gitlab-runsvdir.service:

[Service]
EnvironmentFile=/etc/gitlab/envvars
ExecStart=/opt/gitlab/embedded/bin/runsvdir-start
Restart=always

and then in /etc/gitlab/envvars:

#!/bin/bash
export SIDEKIQ_MEMORY_KILLER_MAX_RSS=12345678
#

No changes. Still SIDEKIQ_MEMORY_KILLER_MAX_RSS is 100000.
The only way I found was to edit /opt/gitlab/etc/gitlab-rails/env/SIDEKIQ_MEMORY_KILLER_MAX_RSS - but I guess it will be overwritten with the next chef run.

How do I set SIDEKIQ_MEMORY_KILLER_MAX_RSS permanently?

// update: I think I was wrong about EnvironmentFile.
Anyway: This does not work either:

[Service]
Environment=SIDEKIQ_MEMORY_KILLER_MAX_RSS=12345678
ExecStart=/opt/gitlab/embedded/bin/runsvdir-start
Restart=always

I would expect you can include that variable according to this example in the gitlab.rb:

##! Docs: https://docs.gitlab.com/omnibus/settings/environment-variables.html
# gitlab_rails['env'] = {
#   'BUNDLE_GEMFILE' => "/opt/gitlab/embedded/service/gitlab-rails/Gemfile",
#   'PATH' => "/opt/gitlab/bin:/opt/gitlab/embedded/bin:/bin:/usr/bin"
# }

that should also sustain through a reconfigure

That looks promising, thank you.

Unfortunately, it does not work either:

gitlab_rails['env'] = {
#   'BUNDLE_GEMFILE' => "/opt/gitlab/embedded/service/gitlab-rails/Gemfile",
#   'PATH' => "/opt/gitlab/bin:/opt/gitlab/embedded/bin:/bin:/usr/bin"
    'SIDEKIQ_MEMORY_KILLER_MAX_RSS' => "9999999"
}

does not set SIDEKIQ_MEMORY_KILLER_MAX_RSS
I think it is time to file a bug report?

mmm, I’ve seen before that although you might have a valid env variable, only certain might be picked up by the chef recipe. With other words: only some selected variables are actually processed.
It might be a bug, it might be a feature request, but that will take some digging into the deployment code. If it should take all, it is a bug, otherwise it is a feature.

One note: on the documentation page it says hard restart, but it might also take a reconfigure, as that creates a lot of configuration files from the gitlab.rb.

Yeah! It ain’t a bug, but more a lack of documentation.
To summarize: gitlab.rb is the right place to set the environment, and it takes a reconfigure/restart (maybe restart sidekiq only?) to apply the change to sidekiq.

Thank you, @bartj!

happy to be of service