https://github.com/karantan/cgroup-mover
Simple tool that moves child processes from one cgroup to another
https://github.com/karantan/cgroup-mover
Last synced: 2 months ago
JSON representation
Simple tool that moves child processes from one cgroup to another
- Host: GitHub
- URL: https://github.com/karantan/cgroup-mover
- Owner: karantan
- License: bsd-3-clause
- Created: 2022-09-09T13:11:53.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-09-27T14:06:12.000Z (over 2 years ago)
- Last Synced: 2025-02-13T15:53:52.461Z (4 months ago)
- Language: Go
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Control Group Mover (cgroup-mover) 
`cgroup-mover` is a simple tool that helps moving processes from one cgroup to a another
cgroup.The idea is to have one cgroup for processes that you want to limit because they consume
too much server resources.Idealy this should be done when a child process is spawn, but this is sometims hard to do
(e.g. php-fpm child workers).That's why we check for child workers every 5 seconds because:
1. We don't want to check too often and cause problems (e.g. file locking)
2. Some processes need a bit more resources at startup (first 1-2 sec) so we try being
nice to them.## Usage
```bash
$ cgroup-mover --help
Usage of cgroup-mover:
-new string
Cgroup TO which all child processes will be moved
-user string
User of which all processes will be moved (e.g. foo_bar)
-old string
Cgroup FROM all child processes will be moved$ cgroup-mover --old grp1 --new grp2
```## Nix
Build it with nix by running:
```bash
$ nix-build -E "with import {}; callPackage ./default.nix {}"
```Add it to NixOS:
```bash
{ config, pkgs, lib, ... }:
letpsusage = pkgs.callPackage (import (fetchGit {
url = "[email protected]:karantan/cgroup-mover";
ref = "master";
rev = ""; # v1.x.y
})) { };in {
environment.systemPackages = [
cgroup-mover
];
}
```