gristlabs_grist-core/app
Dmitry S 2eec48b685 (core) Support adjusting OOM score for child sandbox processes.
Summary:
Also update error handling in NSandbox initialization to avoid node
exiting when sandbox can't be created.

Info on oom_score and choom: https://man7.org/linux/man-pages/man1/choom.1.html

Empirically, in docker and under fargate, oom_score (visible in
/proc/PID/oom_score) seems to be calculated approximately as

    ((ProcessRSS / TotalMemory * 1000 + 999 + oom_score_adj) * 2/3)

though this doesn't correspond to any documentation I could find.

In addition, under docker / fargate it does not work to set oom_score_adj (with choom or via /proc/PID/oom_score_adj) to a negative value to give priority to a node process. That's why this diff adjust the score up for sandbox processes instead.

Test Plan:
Checked that grist-omnibus built with this change respects the
variable, and sandbox processes end up with higher oom_score values.

Reviewers: paulfitz

Reviewed By: paulfitz

Subscribers: paulfitz

Differential Revision: https://phab.getgrist.com/D4112
2023-11-16 17:43:06 -05:00
..
client fix shadowed variable in CustomView (#743) 2023-11-13 10:56:01 -05:00
common (core) Add more telemetry events 2023-11-16 12:38:08 -05:00
gen-server (core) Add more telemetry events 2023-11-16 12:38:08 -05:00
plugin (core) support for bundling custom widgets with the Grist app 2023-10-27 17:00:10 -04:00
server (core) Support adjusting OOM score for child sandbox processes. 2023-11-16 17:43:06 -05:00
tsconfig.json (core) move home server into core 2020-07-21 20:39:10 -04:00