Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/gitlab: Add options to tame GitLab's memory usage somewhat #118898

Merged
merged 3 commits into from Apr 30, 2021

Conversation

talyz
Copy link
Contributor

@talyz talyz commented Apr 9, 2021

Motivation for this change

GitLab is very memory hungry, but there are a few ways to make it slightly less so.

This adds support for Sidekiq MemoryKiller, allows setting the number of Puma workers and threads, and sets MALLOC_ARENA_MAX to 2.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

This should reduce memory fragmentation drastically and is recommended
by both the Puma and the Sidekiq author. It's also the default value
for Ruby deployments on Heroku.
@talyz
Copy link
Contributor Author

talyz commented Apr 28, 2021

I've been using this in production for more than two weeks without issues. I aim to merge this on Friday unless there are objections.

@talyz talyz merged commit fdd6ca8 into NixOS:master Apr 30, 2021
@talyz talyz deleted the gitlab-memory-bloat branch April 30, 2021 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants