use VmHwm mem instead of VmPeak for more accurate memory report

This commit is contained in:
Ruben Fiszel
2023-02-05 15:25:37 +01:00
parent 5ce8dc6a80
commit 20ea3424e0
2 changed files with 22 additions and 22 deletions
+21 -21
View File
@@ -3450,6 +3450,27 @@
},
"query": "UPDATE schedule SET path = $1, script_path = $1 WHERE path = $2 AND workspace_id = $3 AND is_flow IS true RETURNING *"
},
"913c634de21d46b8841f8a7c25c408da7c572f9e685db6351848cbf6e9253efc": {
"describe": {
"columns": [
{
"name": "canceled",
"ordinal": 0,
"type_info": "Bool"
}
],
"nullable": [
false
],
"parameters": {
"Left": [
"Int4",
"Uuid"
]
}
},
"query": "UPDATE queue SET mem_peak = GREATEST($1, mem_peak), last_ping = now() WHERE id = $2 RETURNING canceled"
},
"924e1d5cbb682db0d6121dd911f38cf8948d0e59ca47428daa4f43fce686ba80": {
"describe": {
"columns": [
@@ -4148,27 +4169,6 @@
},
"query": "\n SELECT resume_id, approver\n FROM resume_job\n WHERE job = $1\n "
},
"b020869f68b5f2febbb28e8d2ba08e126cb2038d7d94ae74d47824a0cf7d7655": {
"describe": {
"columns": [
{
"name": "canceled",
"ordinal": 0,
"type_info": "Bool"
}
],
"nullable": [
false
],
"parameters": {
"Left": [
"Int4",
"Uuid"
]
}
},
"query": "UPDATE queue SET mem_peak = COALESCE($1, mem_peak), last_ping = now() WHERE id = $2 RETURNING canceled"
},
"b053117536c067095e2fb2864ce5af33f84b22c24c92fcb870f37f0501f8ea9a": {
"describe": {
"columns": [
+1 -1
View File
@@ -2322,7 +2322,7 @@ async fn get_mem_peak(pid: Option<u32>, nsjail: bool) -> i32 {
if let Ok(file) = File::open(format!("/proc/{}/status", pid)).await {
let mut lines = BufReader::new(file).lines();
while let Some(line) = lines.next_line().await.unwrap_or(None) {
if line.starts_with("VmPeak:") {
if line.starts_with("VmHWM:") {
return line.split_whitespace().nth(1).and_then(|s| s.parse::<i32>().ok()).unwrap_or(-1);
};
}