Skip to content

Commit

Permalink
Change worker validation to check USS not PSS
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jrafanie committed Nov 30, 2017
1 parent 407b468 commit 76db86c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/miq_server/worker_management/monitor/validation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 76db86c

Please sign in to comment.