六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 30|回复: 0

How to improve the performance networking (TCP & UDP) on Linux 2.4+

[复制链接]

升级  26%

3

主题

3

主题

3

主题

童生

Rank: 1

积分
13
 楼主| 发表于 2013-2-4 13:40:36 | 显示全部楼层 |阅读模式
Type: sysctl -p | grep mem
This will display your current buffer settings. Save These! You may want to roll-back these changes

Type: sysctl -w net.core.rmem_max=8388608
This sets the max OS receive buffer size for all types of connections.

Type: sysctl -w net.core.wmem_max=8388608
This sets the max OS send buffer size for all types of connections.

Type: sysctl -w net.core.rmem_default=65536
This sets the default OS receive buffer size for all types of connections.

Type: sysctl -w net.core.wmem_default=65536
This sets the default OS send buffer size for all types of connections.

iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -P PREROUTING ACCEPT
iptables -t mangle -P INPUT ACCEPT
iptables -t mangle -P FORWARD ACCEPT
iptables -t mangle -P OUTPUT ACCEPT
iptables -t mangle -P POSTROUTING ACCEPT
iptables -t mangle -F
iptables -t mangle -X
iptables -t filter -P INPUT ACCEPT
iptables -t filter -P FORWARD ACCEPT
iptables -t filter -P OUTPUT ACCEPT
iptables -t filter -F
iptables -t filter -X

sysctl -w net.core.rmem_max=40960000
sysctl -w net.core.wmem_max=40960000
sysctl -w net.core.rmem_default=65536
sysctl -w net.core.wmem_default=65536
sysctl -w net.ipv4.tcp_rmem='4096 87380 8388608'
sysctl -w net.ipv4.tcp_wmem='4096 65536 8388608'
sysctl -w net.ipv4.tcp_mem='8388608 8388608 8388608'
sysctl -w net.ipv4.route.flush=1

ulimit -n 10240
ulimit -a
sysctl -a |grep net.core
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表