Slide 11
Slide 11 text
.co.uk
www.
### mongodb / attributes / default.rb
include_attribute 'sysctl'
override['sysctl']['params'] = {
# more ports for open connections - 37k
# 27017 is MongoDB listen port!
'net.ipv4.ip_local_port_range' => '28000 65000',
# more concurrent connections when spammed
'net.ipv4.tcp_fin_timeout' => 15,
# recycle sockets in time_wait state
'net.ipv4.tcp_tw_recycle' => 1,
# re-use sockets in time_wait state
'net.ipv4.tcp_tw_reuse' => 1,
# don't waste cycles timestamping tcp packets
'net.ipv4.tcp_timestamps' => 0,
# higher limit for max socket connections (128 is
default)
'net.core.somaxconn' => 37000,
'net.core.netdev_max_backlog' => 4096,
'net.ipv4.tcp_max_syn_backlog' => 4096,
'net.ipv4.tcp_keepalive_time' => 60,
'net.ipv4.tcp_keepalive_probes' => 3
'net.ipv4.tcp_keepalive_intvl' => 90,
'net.core.rmem_max' => 8388608,
'net.core.wmem_max' => 8388608
}
### mongodb / metadata.rb
depends 'sysctl'
### mongodb / recipes / default.rb
include_recipe 'sysctl::apply'
supermarket.chef.io/cookbooks/sysctl