Network Tweaks
Pop this into your /etc/sysctl.conf and reboot
kern.ipc.somaxconn=512 net.inet.tcp.mssdflt=1460 net.inet.tcp.sendspace=98304 net.inet.tcp.recvspace=98304 kern.ipc.maxsockbuf=1048576 net.inet.udp.maxdgram=57344 net.inet.udp.recvspace=42080 net.local.stream.sendspace=98304 net.local.stream.recvspace=98304 net.inet.tcp.delayed_ack=0 net.inet.tcp.rfc1323=1 net.inet.tcp.rfc1644=1 net.inet.tcp.newreno=1
To initiate the changes into the kernel without a reboot, add the above to /etc/sysctl.conf then issue the following command string:
awk '{ if (!index($1, "#") && index($1, "=")) print $1 }' < /etc/sysctl.conf | while read do sysctl -w ${REPLY} done
If successful, you should see the following output from sysctl confirming the changes:
kern.ipc.somaxconn: 128 -> 512 net.inet.tcp.mssdflt: 512 -> 1460 net.inet.tcp.sendspace: 32768 -> 98304 net.inet.tcp.recvspace: 32768 -> 98304 kern.ipc.maxsockbuf: 262144 -> 1048576 net.inet.udp.maxdgram: 9216 -> 57344 net.inet.udp.recvspace: 42080 -> 42080 net.local.stream.sendspace: 8192 -> 98304 net.local.stream.recvspace: 8192 -> 98304 net.inet.tcp.delayed_ack: 3 -> 0 net.inet.tcp.rfc1323: 1 -> 1 net.inet.tcp.rfc1644: 0 -> 1 net.inet.tcp.newreno: 0 -> 1
(Taken directly from the applicable portion of /etc/rc, the primary boot script. While the above Apple command syntax does not really provide much safeguard, and there are more simple ways to apply the changes via command line, this is the way the ATV does it at every reboot and thus the way promoted here.)