Improve RAM usage allowance
Queries can spawn more processed and then use more RAM than `shared_buffers`
This commit is contained in:
@@ -44,13 +44,14 @@ action :create do
|
||||
|
||||
shared_buffers = if node['memory']['total'].to_i / 1024 < 1024 # < 1GB RAM
|
||||
"128MB"
|
||||
else # >= 1GB RAM, use 50% of total RAM
|
||||
"#{node['memory']['total'].to_i / 1024 / 2}MB"
|
||||
else # >= 1GB RAM, use 25% of total RAM
|
||||
"#{node['memory']['total'].to_i / 1024 / 4}MB"
|
||||
end
|
||||
|
||||
additional_config = {
|
||||
max_connections: 200, # default
|
||||
shared_buffers: shared_buffers,
|
||||
work_mem: "4MB",
|
||||
unix_socket_directories: "/var/run/postgresql",
|
||||
dynamic_shared_memory_type: "posix",
|
||||
timezone: "UTC", # default is GMT
|
||||
|
||||
Reference in New Issue
Block a user