Skip to content

Instantly share code, notes, and snippets.

@dakatsuka
Created December 13, 2011 06:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dakatsuka/1470881 to your computer and use it in GitHub Desktop.
Save dakatsuka/1470881 to your computer and use it in GitHub Desktop.
change tcp keepalive (for EC2) / Chef recipe
template "/etc/network/if-up.d/tcp_keepalive_time" do
source "/etc/network/if-up.d/tcp_keepalive_time.erb"
owner "root"
group "root"
mode "0744"
end
script "change tcp keepalive" do
interpreter "bash"
user "root"
code "echo 300 > /proc/sys/net/ipv4/tcp_keepalive_time"
end
#!/bin/sh
echo 300 > /proc/sys/net/ipv4/tcp_keepalive_time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment