]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/squid/templates/default/squid.conf.erb
squid: tune number workers cpu
[chef.git] / cookbooks / squid / templates / default / squid.conf.erb
index f752fc5bdda43be48eb0469393e5a9d0c0947d96..bc6b1aff05642245c4c5de44e3cfa48546199b1c 100644 (file)
@@ -6,7 +6,8 @@ visible_hostname <%= node.name %>
 cache_mem  <%= node[:squid][:cache_mem] %>
 <% if node[:squid][:version] > 2 -%>
 
-workers <%= node[:cpu][:total] %>
+workers <%= [ node[:cpu][:total] - 2, 1 ].max.ceil %>
+cpu_affinity_map process_numbers=<%= (1..[ node[:cpu][:total] - 2, 1 ].max.ceil).to_a.join(',') %> cores=<%=(1..[ node[:cpu][:total] - 2, 1 ].max.ceil).to_a.join(',') %>
 
 error_log_languages off
 <% end -%>
@@ -15,7 +16,7 @@ max_filedescriptors 98304
 
 <% if node[:squid][:version] > 3 -%>
 # Use RFC6891 recommended max size
-dns_packet_max 4096
+dns_packet_max 4096 bytes
 # Use low initial retry interval (backoff start)
 dns_retransmit_interval 2 seconds
 # Set low timeout