Skip to content

Instantly share code, notes, and snippets.

@jvoorhis
Created July 26, 2012 23:21
Show Gist options
  • Save jvoorhis/3185202 to your computer and use it in GitHub Desktop.
Save jvoorhis/3185202 to your computer and use it in GitHub Desktop.
if usage[:cpu] > BEGIN_RENICE_CPU_THRESHOLD
nice = (instance[:nice] || 0) + 1
if nice < MAX_RENICE_VALUE
instance[:nice] = nice
@logger.info("Lowering priority on CPU bound process(#{instance[:name]}), new value:#{nice}")
%x[renice #{nice} -u #{instance[:secure_user]}]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment