Skip to content

Instantly share code, notes, and snippets.

@zpatten
Created March 24, 2014 18:41
Show Gist options
  • Save zpatten/9746434 to your computer and use it in GitHub Desktop.
Save zpatten/9746434 to your computer and use it in GitHub Desktop.
if (node['memory']['total'].to_i / 4) > ((node['chef_server']['postgresql']['shmmax'].to_i / 1024) - 2097152)
# guard against setting shared_buffers > shmmax on hosts with installed RAM > 64GB
# use 2GB less than shmmax as the default for these large memory machines
node.override['chef_server']['postgresql']['shared_buffers'] = "14336MB"
else
node.override['chef_server']['postgresql']['shared_buffers'] = "#{(node['memory']['total'].to_i / 4) / (1024)}MB"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment