linux内核协议栈丢包统计,linux的网络优化与丢包(虽然接收到包但没有响应)...

今天服务器上又出现与对端的mail

server通讯故障,现象就是我方发出向对方mail端口的连接请求后,迟迟得不到对方回应,而且此现象只出现在我方一部分Linux服务器上。

因为时间仓促,来不及抓包仔细分析,但是根据以往的经验判断,可能是网络的核心参数设置上的问题。经查,可以成功接收到回应的设置为:

sysctl -w net.ipv4.tcp_rmem="4096 87380 2097152"

sysctl -w net.ipv4.tcp_wmem="4096 16384 2097152"

而缺省的情况下,失败的服务器上的参数是:

net.ipv4.tcp_rmem =

4096 87380 4194304net.ipv4.tcp_wmem

= 4096 16384 4194304

是否这个缺省的设置值太大了,导致socket在接收到对方回应之后,只是缓存而不通知上层?

网上也没有查到相关的问题报告,只能暂时搁置。

下面是网络设置相关的文章摘要:

Linux TCP Tuning

There are a lot of differences between Linux version 2.4 and 2.6,

so first we'll cover the tuning issues that are the same in both

2.4 and 2.6. To change TCP settings in, you add the entries below

to the file /etc/sysctl.conf, and then run "sysctl -p".

Like all operating systems, the default maximum Linux TCP buffer

sizes are way too small. I suggest changing them to the following

settings:

1234567

# increase TCP max buffer size

net.core.rmem_max = 16777216

net.core.wmem_max = 16777216

# increase Linux autotuning TCP buffer limits

# min, default, and max number of bytes to use

net.ipv4.tcp_rmem = 4096 87380 16777216

net.ipv4.tcp_wmem = 4096 65536 16777216

Note: you should leave tcp_mem alone. The defaults are fine.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值