budgeted agents throttle at 90% of the cap; alert on repeated oom kills
This commit is contained in:
parent
c014b48c22
commit
11393bc538
1 changed files with 201 additions and 27 deletions
|
|
@ -292,9 +292,15 @@ pub async fn write_resource_limits(
|
|||
cpu_quota: &str,
|
||||
cpu_weight: Option<u32>,
|
||||
io_weight: Option<u32>,
|
||||
memory_high: Option<u64>,
|
||||
) -> Result<()> {
|
||||
ok(call(&resource_limits_request(
|
||||
container, memory_max, cpu_quota, cpu_weight, io_weight,
|
||||
container,
|
||||
memory_max,
|
||||
cpu_quota,
|
||||
cpu_weight,
|
||||
io_weight,
|
||||
memory_high,
|
||||
))
|
||||
.await?)
|
||||
}
|
||||
|
|
@ -305,6 +311,7 @@ fn resource_limits_request(
|
|||
cpu_quota: &str,
|
||||
cpu_weight: Option<u32>,
|
||||
io_weight: Option<u32>,
|
||||
memory_high: Option<u64>,
|
||||
) -> PrivRequest {
|
||||
PrivRequest::WriteResourceLimits {
|
||||
container: container.to_owned(),
|
||||
|
|
@ -312,6 +319,7 @@ fn resource_limits_request(
|
|||
cpu_quota: cpu_quota.to_owned(),
|
||||
cpu_weight,
|
||||
io_weight,
|
||||
memory_high,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -654,6 +662,7 @@ mod tests {
|
|||
"200%",
|
||||
Some(50),
|
||||
None,
|
||||
Some(3_865_470_566),
|
||||
));
|
||||
assert_eq!(got["op"], "write_resource_limits");
|
||||
assert_eq!(got["container"], "alice");
|
||||
|
|
@ -661,6 +670,7 @@ mod tests {
|
|||
assert_eq!(got["cpu_quota"], "200%");
|
||||
assert_eq!(got["cpu_weight"], 50);
|
||||
assert_eq!(got["io_weight"], Value::Null);
|
||||
assert_eq!(got["memory_high"], 3_865_470_566_u64);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in a new issue