免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1327 | 回复: 1
打印 上一主题 下一主题

out of socket memory [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-01-10 16:22 |只看该作者 |倒序浏览

out of socket memory








通过此文章,我进行了相关调整,调整过后,就再未出现些相关提示,中文是我自己对照的翻译,水平有限!主要是调整TCP的缓冲区及对TCP连接状态进行调整及TCP状态队列
后两个之前有调整,这次只高速了TCP的缓冲区

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.

增加TCP 发送和接收缓冲区对性能有很大的提高,在你有大文件发送的情况下

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.

如果你有大文件上传,增大接收缓冲区对给你带来帮助
  1. 01.net.ipv4.tcp_rmem = 4096 87380 524288

  2. 02.net.core.rmem_max = 1048576
  3. 复制代码
复制代码

  1. # These ensure that TIME_WAIT ports either get reused or closed fast.

  2. 以下参数确保TIME_WAIT 快速关闭

  3. 01.net.ipv4.tcp_fin_timeout = 1   ##打开fin_wait 快速关闭参数

  4. 02.net.ipv4.tcp_tw_recycle = 1     ##快速回收fin_wait参数
  5. 复制代码
复制代码
设置内核TCP的相关参数
# TCP memory
  1. 01.net.core.rmem_max = 16777216  ##内核最大接收缓冲  16M

  2. 02.net.core.rmem_default = 16777216  ##内核?认接收缓冲 16M

  3. 03.net.core.netdev_max_backlog = 262144   ##2M

  4. 04.net.core.somaxconn = 262144    ##2M
  5. 复制代码
复制代码
  1. 01.net.ipv4.tcp_syncookies = 1   ##打开SYN_COOKIE

  2. 02.net.ipv4.tcp_max_orphans = 262144  ##2M

  3. 03.net.ipv4.tcp_max_syn_backlog = 262144  ##SYN 队列大小  2M

  4. 04.net.ipv4.tcp_synack_retries = 2  ##SYN_ACK重试次数  2秒

  5. 05.net.ipv4.tcp_syn_retries = 2   ## SYN 重试次数   2秒
  6. 复制代码
复制代码
# 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

如果用到IPTABLES 同样要增长ip_conntrack 的大小,这个是iptables 所管理的状态数目
  1. 01.net.ipv4.ip_conntrack_max = 1048576

  2. 02.net.ipv4.netfilter.ip_conntrack_max = 1048576
  3. 复制代码
复制代码

论坛徽章:
0
2 [报告]
发表于 2012-01-10 16:22 |只看该作者
谢谢分享
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP