免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: xfsoul
打印 上一主题 下一主题

[FreeBSD] 精通polling参数调优的进来帮帮忙吧 [复制链接]

论坛徽章:
0
31 [报告]
发表于 2006-05-25 08:53 |只看该作者
原帖由 xfsoul 于 2006-5-25 08:41 发表
楼上的大哥,您太强了!
不过有三个MSIZE的定义,而且值还不一样,到底要怎么改呢?
-bash-2.05b# cd /usr/src/sys
-bash-2.05b# grep -r "#define MSIZE" *
compile/NTD/machine/param.h:#define  ...



改这个里面的:
/usr/src/sys/sys/param.h

论坛徽章:
0
32 [报告]
发表于 2006-05-25 08:54 |只看该作者
Before you modify the value, use sysctl -a |grep mbuf to check the mbuf utilization. According to TCP/IP Illustrated Vol.2, bigger packets uses not only mbuf, but also mbufclusters.

论坛徽章:
0
33 [报告]
发表于 2006-05-25 08:56 |只看该作者
原帖由 雨丝风片 于 2006-5-25 08:53 发表



改这个里面的:
/usr/src/sys/sys/param.h

I think modify the source file is finding trouble.
Simply recompile the kernel with this

  1. options MSIZE=512
复制代码

in your kernel configuration file.

论坛徽章:
0
34 [报告]
发表于 2006-05-25 09:05 |只看该作者
# sysctl -a | grep mbuf
     mbuf_tag     0     0K       -        2  32
mbuf_jumbo_1:  16384,        0,      0,      0,        0
mbuf_jumbo_9:   9216,        0,      0,      0,        0
mbuf_jumbo_p:   4096,        0,      0,      0,        0
mbuf_cluster:   2048,    16960,   2176,      6,     2176
mbuf:            256,        0,   2178,    132,     6933
mbuf_packet:     256,        0,   1024,   1286, 176098214

论坛徽章:
0
35 [报告]
发表于 2006-05-25 09:08 |只看该作者
原帖由 antijp 于 2006-5-25 08:54 发表
Before you modify the value, use sysctl -a |grep mbuf to check the mbuf utilization. According to TCP/IP Illustrated Vol.2, bigger packets uses not only mbuf, but also mbufclusters.


楼主测试的数据包大小是确定的,改这个值就是想尽量避免使用cluster,看看从对纯mbuf的处理和对cluster的处理流程上是否能找到一些线索。但我感觉应该不只是处理流程的区别,很可能和内存的分配、缓存、复用也有关系。多试无妨。

论坛徽章:
0
36 [报告]
发表于 2006-05-25 09:14 |只看该作者
xfsoul:等你的消息,我想看看到底是不是m_devget的问题
另:antijp的方法很好.我对使用FB不太熟悉

[ 本帖最后由 xie_minix 于 2006-5-25 09:16 编辑 ]

论坛徽章:
0
37 [报告]
发表于 2006-05-25 09:36 |只看该作者
原帖由 雨丝风片 于 2006-5-25 09:08 发表


楼主测试的数据包大小是确定的,改这个值就是想尽量避免使用cluster,看看从对纯mbuf的处理和对cluster的处理流程上是否能找到一些线索。但我感觉应该不只是处理流程的区别,很可能和内存的分配、缓存、复用也 ...

According to the statistics posted out, the mbufclusters must have been used. But I doubt that this statistics was not gathered when running the benchmark, so perhaps it's not very useful.

[ 本帖最后由 antijp 于 2006-5-25 09:46 编辑 ]

论坛徽章:
0
38 [报告]
发表于 2006-05-25 09:47 |只看该作者
原帖由 antijp 于 2006-5-25 09:36 发表

According to the statistics posted out, the mbufclusters must have been used. But I doubt that this statistics was not gathered when running the benchmark, so perhaps it't not very useful.


从楼主的数据长度即可判断出测试的时候肯定会使用cluster了:
If the amount of data is greater than or equal to 208 (MINCLBYTES), one or more clusters are used.

当然,由于mbuf头结构的修改,目前的门限数值比208还要小。现在就是想先看看它不用cluster的时候的测试性能如何。

论坛徽章:
0
39 [报告]
发表于 2006-05-25 09:50 |只看该作者
我编译内核加了:
options         MSIZE=1024


options         BRIDGE
options         DEVICE_POLLING
options         HZ=4000

编译好后,测试包长为512字节, 发现性能没有丝毫提升。
下面是smartbit发包的时候,读出来的系统数据:
# sysctl kern.polling
kern.polling.idlepoll_sleeping: 1
kern.polling.stalled: 66
kern.polling.suspect: 6042
kern.polling.phase: 0
kern.polling.enable: 1
kern.polling.handlers: 4
kern.polling.residual_burst: 0
kern.polling.pending_polls: 0
kern.polling.lost_polls: 6762
kern.polling.short_ticks: 1178
kern.polling.reg_frac: 20
kern.polling.user_frac: 30
kern.polling.idle_poll: 0
kern.polling.each_burst: 100
kern.polling.burst_max: 300
kern.polling.burst: 300


# sysctl -a | grep mbuf
     mbuf_tag     0     0K       -        2  32
mbuf_jumbo_1:  16384,        0,      0,      0,        0
mbuf_jumbo_9:   9216,        0,      0,      0,        0
mbuf_jumbo_p:   4096,        0,      0,      0,        0
mbuf_cluster:   2048,    16960,   1920,      6,     1920
mbuf:           1024,        0,   1922,    126,     1245
mbuf_packet:    1024,        0,   1990,     58, 15962674

[ 本帖最后由 xfsoul 于 2006-5-25 09:52 编辑 ]

论坛徽章:
0
40 [报告]
发表于 2006-05-25 09:54 |只看该作者
kern.polling.burst_max: 300
kern.polling.burst: 300
这两个值一样,似乎burst不够用了,继续调大些试试看??
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP