Skip to content

Commit 0cfec7e

Browse files
committed
Encourage the OOM killer to pick the container processes
play.rust-lang.org has had a few outages because the machine is a bit low on memory and the OOM killer picks to reap nginx. There are many containers running using a small amount of memory while the one nginx uses more, so it's a more attractive target. My ideal situation would be if we could group all the containers and kill from that pool until the memory pressure is resolved, but I don't know how to do that.
1 parent 04c5ed9 commit 0cfec7e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

compiler/base/orchestrator/src/coordinator.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,8 @@ fn basic_secure_docker_command() -> Command {
12111211
"640m",
12121212
"--pids-limit",
12131213
"512",
1214+
"--oom-score-adj",
1215+
"1000",
12141216
)
12151217
}
12161218

ui/src/sandbox.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ fn basic_secure_docker_command() -> Command {
137137
"PLAYGROUND_TIMEOUT={}",
138138
DOCKER_PROCESS_TIMEOUT_SOFT.as_secs()
139139
),
140+
"--oom-score-adj",
141+
"1000",
140142
);
141143

142144
if cfg!(feature = "fork-bomb-prevention") {

0 commit comments

Comments
 (0)