From 04c899553ba73366746d30e69e7298da1da74c5f Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Thu, 30 Nov 2017 15:29:26 -0500 Subject: [PATCH] Change worker validation to check USS not PSS https://bugzilla.redhat.com/show_bug.cgi?id=1479356 Why? USS is a more reliable mechanism for tracking workers with runaway memory growth. PSS is great, until the server process that forks new processes grows large. As each new worker is forked, it inherits a share of the large amount of the parent process' memory and therefore starts with a large PSS, possibly exceeding our limits before doing any work. USS only measures a process' private memory and is a better indicator when a process is responsible for allocating too much memory without freeing it. --- app/models/miq_server/worker_management/monitor/validation.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/miq_server/worker_management/monitor/validation.rb b/app/models/miq_server/worker_management/monitor/validation.rb index 63d81ef3da77..fe19b38cd303 100644 --- a/app/models/miq_server/worker_management/monitor/validation.rb +++ b/app/models/miq_server/worker_management/monitor/validation.rb @@ -20,8 +20,8 @@ def validate_worker(w) return true unless worker_get_monitor_status(w.pid).nil? - # Proportional set size is only implemented on linux - usage = w.proportional_set_size || w.memory_usage + # Unique set size is only implemented on linux + usage = w.unique_set_size || w.memory_usage if MiqWorker::STATUSES_CURRENT.include?(w.status) && usage_exceeds_threshold?(usage, memory_threshold) msg = "#{w.format_full_log_msg} process memory usage [#{usage}] exceeded limit [#{memory_threshold}], requesting worker to exit" _log.warn(msg)