首页 > 未分类 > 解决Out of socket memory

解决Out of socket memory

2007年10月22日 baoz 阅读评论 680 views

echo “1″ > /proc/sys/net/ipv4/tcp_synack_retries
echo “1″ > /proc/sys/net/ipv4/tcp_syn_retries
echo “409600″>    /proc/sys/net/ipv4/route/max_size
echo “2621400″ >/proc/sys/net/ipv4/ip_conntrack_max
echo “4096 87380 349520″ > /proc/sys/net/ipv4/tcp_rmem
echo “4096 87380 349520″ > /proc/sys/net/ipv4/tcp_wmem
echo “500000″ > /proc/sys/net/ipv4/tcp_max_tw_buckets

Increasing the TCP send and receive buffers will increase the performance a lot if (and only if) you have a lot of large files to send.

  • net.ipv4.tcp_wmem = 4096 65536 524288
  • net.core.wmem_max = 1048576

If you have a lot of large file uploads, increasing the receive buffers will help.

  • net.ipv4.tcp_rmem = 4096 87380 524288
  • net.core.rmem_max = 1048576

# These ensure that TIME_WAIT ports either get reused or closed fast.
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_tw_recycle = 1
# TCP memory
net.core.rmem_max = 16777216
net.core.rmem_default = 16777216
net.core.netdev_max_backlog = 262144
net.core.somaxconn = 262144

net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2

# you shouldn’t be using conntrack on a heavily loaded server anyway, but these are
# suitably high for our uses, insuring that if conntrack gets turned on, the box doesn’t die
net.ipv4.netfilter.ip_conntrack_max = 1048576
net.nf_conntrack_max = 1048576

包子猜您可能还喜欢下列文章:

  1. sysctl参数备份
  2. Enabling High Performance Data Transfers
  3. Out of socket memory
  4. Netfilter conntrack performance tweaking
  5. TCP performance tuning – how to tune linux

分类: 未分类 标签:
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.