DataMind OS gives every service a memory limit and a memory reservation, sized from the host's own
RAM. The DataMind Installer calculates them, writes them into deployment/, and checks that the
host can enforce them. The calculation is made when it is asked for; it is never stored.
Change the values in Configuration. This page explains what the numbers mean, how they move, and what the host must provide.
The limits sit in deployment/, in a generated block between two marker comment lines: one
starts with # >>>, the other with # <<<. The Installer rewrites the block every time it generates
the file, so on every save, install and update.
A hand edit inside the generated block is lost at the next save, install or update. Edit the rows in Configuration instead; there your values are kept.
Service rows come first, the host's rows last:
| Row | What it carries |
|---|---|
<SERVICE>_MEM_LIMIT | The ceiling for a service's container; a container that goes over it is killed |
<SERVICE>_MEM_RESERVATION | The memory the service is guaranteed |
<SERVICE>_OOM_SCORE_ADJ | The service's place in the kill order; see The kill order |
<SERVICE>_SLICE | Present for protected services, which run in a memory slice of their own |
<SERVICE>_ENABLED | true or false, for services that can be switched off |
MEMORY_POOL_MB | The pool the calculation worked from |
Above the rows, comment lines record how the block was made: when it was generated, the host, its
class, the pool and the host reserve, the reservation budget, and whether anything was scaled. When
your edits are in play, one line lists them:
# hand-edited, dependent rows recalculated from them: <codes>.
Available memory does not run out silently. earlyoom, the host's memory killer, watches it: below
EARLYOOM_SIGTERM_BELOW it asks processes to stop, and below EARLYOOM_SIGKILL_BELOW it kills
them. Both thresholds follow the host's class, and the class follows the host's RAM:
| Class | Covers hosts with | EARLYOOM_SIGTERM_BELOW | EARLYOOM_SIGKILL_BELOW |
|---|---|---|---|
| small | under 32 GiB | 3072m | 1536m |
| medium | 32 GiB or more, under 64 GiB | 4096m | 2048m |
| large | 64 GiB or more, under 128 GiB | 6144m | 3072m |
| xlarge | 128 GiB or more, under 256 GiB | 10240m | 5120m |
| xxlarge | 256 GiB or more (the catch-all class) | 16384m | 8192m |
The boundaries exclude the upper value: a host with exactly 32 GiB is medium, and a host one MiB smaller is small. Hosts of 256 GiB or more all land in xxlarge. Sizes on this page are binary, as the Installer writes them: 1 GiB is 1024 MiB.
For choosing a host's size in the first place, see System requirements.
Two numbers bound the plan:
| Number | What it is |
|---|---|
| The pool | The host's RAM minus a 10% reserve for the host itself. Every limit and reservation is sized from it, and it is written as MEMORY_POOL_MB |
| The reservation budget | 75% of the pool |
When the calculated reservations do not fit the budget, the Installer scales them down rather than
drop them (never below 16m each), keeps your hand-edited values as they are, and records it in the
comment lines.
The calculation reports a few flags with the plan:
| Flag | What it means |
|---|---|
| scaled | The machine could not fit the configured reservations, so they were shrunk. Treat it as a sizing signal: the host is smaller than the plan wants |
| conflicts | Codes the Installer wanted to write but could not, because the template already owns the code or two services claim the same one. Nothing is written for them |
| problems | Hand edits the slice script would refuse, or values that cannot be read. Deploys are refused while this is not empty; see When the settings block a deploy |
| blocking | The calculation cannot produce a usable plan at all. Deploys are refused while it is in this state |
When memory runs short, the host kills the process with the highest OOM score first. A service's score starts from its tier bias and drops with its reservation:
600, and critical services carry 0. Batch is the
default tier.1000 times the reservation's share of the host's RAM.The result is rounded and kept within -999 and 1000. A batch service that reserves about a tenth
of RAM scores around 500; a critical service that reserves about a third scores around -333. The
higher a score sits, the sooner that service gives way, so batch work yields before core services.
A memory row in Configuration shows the calculated value until you replace it. Type a new value and save; the calculation keeps yours and recalculates the rows that depend on it.
| The row | It accepts |
|---|---|
| A per-service memory value | A whole number with an optional unit: m, mb, mib, g, gb or gib, any case. 8g is saved as 8192m, and a bare number means MiB |
| A row the memory-slice script reads on the host | Only a whole number of MiB with a lowercase m, such as 1024m. An uppercase unit is refused here |
| An OOM score row | A whole number, such as -500 |
An _ENABLED row | true or false |
A value that does not fit its row is refused as <CODE> is '<value>', expected <what the row accepts>.
The expectation text names the rule, for example a whole number of MiB with a lowercase m for a
row the host script reads. A value containing a line break is refused as <CODE> contains a line break.
The Installer refuses to deploy or apply configuration while the plan has problems or is blocking, and says which:
Memory limits could not be computed: <reason>.Memory settings are invalid: <problems separated by "; ">.Each problem names its rows. The ones you can hit:
| The problem | What it means |
|---|---|
Protected memory <n> MiB exceeds 75% of the <pool> MiB pool (<budget> MiB) | The protected services' reservations together exceed the budget. Example: Protected memory 30000 MiB exceeds 75% of the 28882 MiB pool (21661 MiB). Lower a protected reservation, or give the host more RAM |
<RESERVATION> is <n> MiB, above <LIMIT> <m> MiB | A reservation sits above its own limit. Example: CLICKHOUSE_MEM_RESERVATION is 5000 MiB, above CLICKHOUSE_MEM_LIMIT 4000 MiB. Raise the limit, or lower the reservation |
Edited reservations sum to <n> MiB, above the <m> MiB reservation budget | Your edits alone exceed the budget. Lower or reset some |
EARLYOOM_SIGKILL_BELOW is <n> MiB, above EARLYOOM_SIGTERM_BELOW <m> MiB | The kill threshold sits above the ask threshold. The kill value must be the lower of the two |
| The slices claim more MiB than the slice minimum row allows | The slice rows disagree about the same memory. Reset the hand edits, or align the rows |
Conflicts do not block anything: a conflicting code is simply left unwritten. Fix the rows a problem names, save, and run the action again. Deploys run from Service status.
The limits are applied to the host by deployment/, a script the Installer
downloads with each deploy (see What lives on the host). Before
it applies them, it checks seven things, and all seven must pass:
| Check | Passes when | The detail reports |
|---|---|---|
cgroup v2 | cgroup v2 is mounted | cgroup v2 is mounted, or / |
Kernel 5. | The kernel is 5.9 or newer | Kernel <version> |
memory_recursiveprot | cgroup v2 is mounted with memory_recursiveprot | cgroup2 is mounted with memory_recursiveprot, or cgroup2 is mounted without memory_recursiveprot |
Swap off | The host has no swap | Swap <n> MiB |
RAM 15 GiB or more | Total RAM is at least 15 GiB | <total> MiB, at least <needed> MiB needed |
Docker cgroup driver systemd | Docker uses the systemd cgroup driver | Cgroup driver <driver> |
Rootful Docker | Docker runs as root | Docker runs as root, or Docker runs rootless |
When a check cannot run at all, its detail says why: Host could not be inspected: . or
Docker could not be inspected: ..
The slice script can refuse too:
Behind every hand value the calculation still keeps the value it would have chosen. A reset brings it back:
Each reset runs behind a preview first, and a preview writes nothing. The outcomes are
Value reset to the calculated one and Memory values reset to the calculated ones. A reset is
refused when it would make the memory problems worse; the preview says why.
Rows the calculation does not own cannot be reset:
Configuration "<code>" is not a calculated memory row and cannot be reset. The host's fixed slice
rows cannot be changed or reset:
Configuration "<code>" is a fixed systemd slice name and cannot be changed.
The Reset controls are on Configuration.
Sizes are saved in MiB. 8g becomes 8192m, and a bare number means MiB. The form accepts m,
mb, mib, g, gb and gib in any case; a few rows that the host script reads accept only a
lowercase m.
deployment/ . env directly?No. The block is rewritten on every save, install and update, so edits made in the file are lost. Edit the rows in Configuration: your value is kept, and the rows that depend on it are recalculated.
No. The configured reservations did not fit the reservation budget, so the Installer shrank them, and the plan fits the host again. Treat it as a sizing signal, and review the edited reservations or the host's RAM.
The plan has problems or is blocking. The refusal names what to fix:
Memory settings are invalid: <problems separated by "; ">. Fix the rows each problem names, then
run the action again; the details are in
When the settings block a deploy.
The protected services reserve more together than the reservation budget allows, which is 75% of the pool. The message shows the exact numbers; lower a protected reservation, or give the host more RAM.
Raise the limit above the reservation, or lower the reservation. A reservation must fit inside its
own limit, and the Installer refuses the plan while one does not. The message reads
CLICKHOUSE_MEM_RESERVATION is 5000 MiB, above CLICKHOUSE_MEM_LIMIT 4000 MiB, using your own rows.
They fall into different host classes: a host with exactly 32 GiB is medium, and one MiB smaller is small. Inside a class, the rows are sized from each host's own pool, so they differ with RAM.
earlyoom steps in: below the class's EARLYOOM_SIGTERM_BELOW it asks processes to stop, and below
EARLYOOM_SIGKILL_BELOW it kills them, highest OOM score first. Batch services give way before
critical ones.
The score starts as the tier bias (600 for batch, 0 for critical) and drops by 1000
times the service's reservation share of RAM, so most scores are negative. Scores are kept within
-999 and 1000, and a higher score is killed first.
Reset them: Reset on a row, or Reset all hand-edited memory limits. Each reset is previewed
first, showing the calculated value that returns and any other row that moves with it. The outcomes
are Value reset to the calculated one and Memory values reset to the calculated ones; the
controls are on Configuration.
Seven: cgroup v2, Kernel 5., memory_recursiveprot, Swap off,
RAM 15 GiB or more, Docker cgroup driver systemd and Rootful Docker. Each check reports what
it found; fix the host and check again. See
Host prerequisites for memory slices.