Skip to content

Commit

Permalink
Merge pull request #16570 from jrafanie/USS_all_the_things
Browse files Browse the repository at this point in the history
Use USS (unique set size) instead of PSS for all the things
  • Loading branch information
carbonin authored Dec 15, 2017
2 parents 2da3d19 + ef84a88 commit eee0570
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/models/miq_server/status_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def status_update
def log_status
log_system_status
svr = my_server(true)
_log.info("[#{svr.friendly_name}] Process info: Memory Usage [#{svr.memory_usage}], Memory Size [#{svr.memory_size}], Proportional Set Size: [#{svr.proportional_set_size}], Memory % [#{svr.percent_memory}], CPU Time [#{svr.cpu_time}], CPU % [#{svr.percent_cpu}], Priority [#{svr.os_priority}]") unless svr.nil?
_log.info("[#{svr.friendly_name}] Process info: Memory Usage [#{svr.memory_usage}], Memory Size [#{svr.memory_size}], Proportional Set Size: [#{svr.proportional_set_size}], Unique Set Size: [#{svr.unique_set_size}], Memory % [#{svr.percent_memory}], CPU Time [#{svr.cpu_time}], CPU % [#{svr.percent_cpu}], Priority [#{svr.os_priority}]") unless svr.nil?
end

def log_system_status
Expand Down
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
2 changes: 1 addition & 1 deletion app/models/miq_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def status_update
end

def log_status(level = :info)
_log.send(level, "[#{friendly_name}] Worker ID [#{id}], PID [#{pid}], GUID [#{guid}], Last Heartbeat [#{last_heartbeat}], Process Info: Memory Usage [#{memory_usage}], Memory Size [#{memory_size}], Proportional Set Size: [#{proportional_set_size}], Memory % [#{percent_memory}], CPU Time [#{cpu_time}], CPU % [#{percent_cpu}], Priority [#{os_priority}]")
_log.send(level, "[#{friendly_name}] Worker ID [#{id}], PID [#{pid}], GUID [#{guid}], Last Heartbeat [#{last_heartbeat}], Process Info: Memory Usage [#{memory_usage}], Memory Size [#{memory_size}], Proportional Set Size: [#{proportional_set_size}], Unique Set Size: [#{unique_set_size}], Memory % [#{percent_memory}], CPU Time [#{cpu_time}], CPU % [#{percent_cpu}], Priority [#{os_priority}]")
end

def current_timeout
Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/evm_application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def self.output_servers_status(servers)
s.drb_uri,
s.started_on && s.started_on.iso8601,
s.last_heartbeat && s.last_heartbeat.iso8601,
(mem = (s.proportional_set_size || s.memory_usage)).nil? ? "" : mem / 1.megabyte,
(mem = (s.unique_set_size || s.memory_usage)).nil? ? "" : mem / 1.megabyte,
s.is_master,
s.active_role_names.join(':'),
]
Expand All @@ -104,7 +104,7 @@ def self.output_workers_status(servers)
w.queue_name || w.uri,
w.started_on && w.started_on.iso8601,
w.last_heartbeat && w.last_heartbeat.iso8601,
(mem = (w.proportional_set_size || w.memory_usage)).nil? ? "" : mem / 1.megabyte]
(mem = (w.unique_set_size || w.memory_usage)).nil? ? "" : mem / 1.megabyte]
end
end

Expand Down

0 comments on commit eee0570

Please sign in to comment.