佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1081|回复: 14

FreeBSD-7.0 路由器超烂!!!!

[复制链接]
发表于 5-6-2008 07:58 PM | 显示全部楼层 |阅读模式
从网络A到网络B慢到!!!
#iperf -i1 -t 30 -c 192.168.4.2
[  4] local 192.168.3.2 port 5001 connected with 192.168.4.2 port 57044
[  4]  0.0-20.2 sec  4.97 MBytes  2.07 Mbits/sec

还特地买了dual-port intel GBit网卡。看来没救了。。。 FreeBSD在骗人。。。 还说什么xxx比linux还要快。。。

以下是linux router performance test. 以100MBit fast ethernet  作的测试。
[  5] local 192.168.4.2 port 5001 connected with 192.168.3.2 port 56116
[  5]  0.0-10.0 sec    112 MBytes  94.0 Mbits/sec

router 有4个fast ethernet.  
each of them configured on seperated subnet IP address.
eg:
ste0:192.168.2.1
ste1: 192.168.3.1
ste2: 192.168.4.1
rl0:192.168.1.5
got three host configured as:
host A: 192.168.2.2
host B: 192.168.3.2
host C: 192.168.4.2
all host connected with cross ethernet cable.
anywhere, the result is painfully bad.... damn bad... :@:@:@
回复

使用道具 举报


ADVERTISEMENT

发表于 5-6-2008 11:39 PM | 显示全部楼层
redhat的gfs也是超级的烂。
还说倒很厉害。

我google了一阵子,才发现大家都是在弹gfs。

很多东西都是说而已。 他们的报告不要相信。
回复

使用道具 举报

 楼主| 发表于 6-6-2008 08:30 AM | 显示全部楼层
haiz,..... 浪费了不少时间。据说FREEBSD4 比freebsd5 以上的version还要快。有谁用过openbsd 来做路由器吗? 有的话,它的速度怎么样?
回复

使用道具 举报

发表于 6-6-2008 02:38 PM | 显示全部楼层
可以的。
我们这里用都没有事情。
呵呵
回复

使用道具 举报

发表于 6-6-2008 02:58 PM | 显示全部楼层
man 7 tuning看看你需要tweak的。。stock OS不是为路由器而设定的。

net.inet.tcp.sendspace
net.inet.tcp.recvspace
net.inet.tcp.delayed_ack
kern.ipc.somaxconn
net.inet.ip.fastforwarding
kern.ipc.maxsockbuf
kern.ipc.nmbclusters

还有检查你的nic的config和是否用对driver。
回复

使用道具 举报

发表于 6-6-2008 04:13 PM | 显示全部楼层
偶之前的test没酱fair。。。下次test了在补回。
回复

使用道具 举报

Follow Us
 楼主| 发表于 6-6-2008 04:53 PM | 显示全部楼层
其实很多东西可以tune的都已改了。
ethernet 用的是em driver. 82546EB chipset.
#cat /etc/sysctl.conf
net.inet.ip.forwarding=1    # Enable IP Forwarding
net.inet.ip.fastforwarding=1    # Enable IP Fast Forwarding
net.inet.ip.redirect=0        # Disable IP redirect
net.inet.ip.random_id=1        #
net.inet.ip.ttl=255        # Time to Live set to 255ms
net.inet.ip.intr_queue_maxlen=4096

kern.maxfiles=131072
kern.maxfilesperproc=32768
kern.maxprocperuid=32768

kern.ipc.maxsockets=32768
kern.ipc.maxsockbuf=16777216    # Maximum Window Size net.inet.tcp.recvspace < kern.ipc.maxsockbuf
kern.ipc.nmbclusters=262144
kern.ipc.somaxconn=65535    # Kern Max Connections

net.inet.tcp.rfc1323=1          # RFC1323 TCP window scaling (0 -> 1)
net.inet.tcp.sack.enable=1      # Selective Acknowledgments Option (0 -> 1)
net.inet.tcp.sendspace=4194304     # Increase TCP windows size to increase performance
net.inet.tcp.recvspace=4194304    # "   
net.inet.tcp.recvbuf_inc=32768  # "
net.inet.tcp.sendbuf_inc=32768 # "
net.inet.tcp.delayed_ack=1    # Enable the TCP delay ACK
net.inet.tcp.delacktime=100    # Delay ACK time 100ms
net.inet.tcp.inflight.enable=1    # Enable TCP inflight.
net.inet.tcp.inflight.min=6144    # Recommended by man page
net.inet.tcp.local_slowstart_flightsize=10    # "
net.inet.tcp.nolocaltimewait=1            # "
net.inet.tcp.hostcache.purge=1            # "
net.inet.tcp.msl=2500

net.inet.udp.checksum=0
net.inet.udp.recvspace=4194304  # Increase UDP windows size to increase performance

kern.random.sys.harvest.interrupt=0
kern.random.sys.harvest.ethernet=0                    # disable kernel harvest interrupt counter
net.local.stream.sendspace=4194304              # Tuning for loopback
net.local.stream.recvspace=4194304              # "
net.route.netisr_maxqlen=512


#cat /boot/loader.conf
autoboot_delay="3"
hw.em.rxd="1024"
hw.em.txd="1024"
net.inet.tcp.tcbhashsize="4096"
net.inet.tcp.hostcache.hashsize="1024"
vm.kmem_size="512M"
vm.kmem_size_max="512M"
回复

使用道具 举报

发表于 6-6-2008 05:51 PM | 显示全部楼层
原帖由 joebabe 于 6-6-2008 04:53 PM 发表
其实很多东西可以tune的都已改了。
ethernet 用的是em driver. 82546EB chipset.
#cat /etc/sysctl.conf
net.inet.ip.forwarding=1    # Enable IP Forwarding
net.inet.ip.fastforwarding=1    # Enable IP Fast Forwarding
net.inet.ip.redirect=0        # Disable IP redirect
net.inet.ip.random_id=1        #


你的tuning好夸张哦。你明白其用意吗?乱调的话会弄巧反拙。如果你想试FreeBSD的network性能,从最简单的试起。

Tuning #1
/boot/loader.conf
autoboot_delay="3"

/etc/rc.conf
gateway_enable="YES"


/etc/sysctl.conf
net.inet.ip.fastforwarding=1


Tuning #2
/boot/loader.conf
autoboot_delay="3"
hw.em.rxd=1024
hw.em.txd=1024

/etc/rc.conf
gateway_enable="YES"


/etc/sysctl.conf
net.inet.ip.fastforwarding=1
kern.ipc.somaxconn=1024


接下来试recvspace/sendspace,但不要多过65536。千万不要去乱调。
net.inet.tcp.tcbhashsize
net.inet.tcp.hostcache.hashsize
vm.kmem_size
vm.kmem_size_max
回复

使用道具 举报


ADVERTISEMENT

发表于 6-6-2008 05:56 PM | 显示全部楼层
你也可以检查其用量才做调整。用netstat就可以了。
netstat -m
回复

使用道具 举报

 楼主| 发表于 6-6-2008 06:51 PM | 显示全部楼层

回复 9# chfl4gs_ 的帖子

的确是多了点
netstat -m show the network buffers not using even 10% of the allocated memory.

4167/1338/5505 mbufs in use (current/cache/total)
4099/1283/5382/262144 mbuf clusters in use (current/cache/total/max)
4098/766 mbuf+clusters out of packet secondary zone in use (current/cache)
0/27/27/12800 4k (page size) jumbo clusters in use (current/cache/total/max)
0/0/0/6400 9k jumbo clusters in use (current/cache/total/max)
0/0/0/3200 16k jumbo clusters in use (current/cache/total/max)
9239K/3008K/12248K bytes allocated to network (current/cache/total)
0/0/0 requests for mbufs denied (mbufs/clusters/mbuf+clusters)
0/0/0 requests for jumbo clusters denied (4k/9k/16k)
0/4/6656 sfbufs in use (current/peak/max)
0 requests for sfbufs denied
0 requests for sfbufs delayed
0 requests for I/O initiated by sendfile
0 calls to protocol drain routines

以下的tcp windows size 因该无关要紧。我所有的host 都有enable windows size scaling 的。开始的时候我是用262144。
net.inet.tcp.sendspace=4194304  
net.inet.tcp.recvspace=4194304
回复

使用道具 举报

发表于 6-6-2008 07:10 PM | 显示全部楼层
调太多的话,反而浪费memory buffer。本来可以用来提升性能的资源,都给你调整/霸占了。。。建议recvspace/sendspace调到16384或32768。262144真的是太多了。
回复

使用道具 举报

 楼主| 发表于 9-6-2008 05:13 PM | 显示全部楼层
其实这台机只是拿来当做路由器来用,所以我放一半的内存用在network buffer 上面。 没想到freebsd-7.0速度这么慢。。慢。。慢。。。
换了以下的windows size. 我的iperf速度还是一样。还是3mbit/s. 太糙了。
net.inet.tcp.sendspace=32768  
net.inet.tcp.recvspace=32768

我怀疑是kernel driver 问题。 不过无所谓啦。已经编译过n次内核。。。换了很多的内核参数(UP-kernel,SMP kernel, NO giantlock... etc )。。。。 还是放弃吧。
回复

使用道具 举报

发表于 10-6-2008 01:22 AM | 显示全部楼层
还没遇到这种问题。偶也是用Intel dual port Gigabits PCI-express。速度一流。试验服务器上安装了2 x D-Link(rl),2 x Intel dual port(em)网卡,内置网卡 dual broadcom (bge)。八个ports 都跑的好好的。如果是driver问题,建议lz上载FreeBSD kern pr,以便FreeBSD开发队可以更改driver。
回复

使用道具 举报

 楼主| 发表于 10-6-2008 05:03 PM | 显示全部楼层

回复 13# chfl4gs_ 的帖子

呵呵呵呵。。。 我也不知道是什么问题。你也是用freebsd-7.0吗?
回复

使用道具 举报

发表于 10-6-2008 10:50 PM | 显示全部楼层
原帖由 joebabe 于 10-6-2008 05:03 PM 发表
呵呵呵呵。。。 我也不知道是什么问题。你也是用freebsd-7.0吗?


嗯,7.0很不错下。将要发布的HeX 2.0是将以7.0为基。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 13-6-2024 11:37 PM , Processed in 0.063638 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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