網頁

2005年10月14日 星期五

超神奇的網卡 polling

不知道多久之前,好像是 10/4 吧。cvsup 的時候習慣性都會看一下 src 底下的 UPDATING 看看有沒有什麼新鮮事,那時就看到了:

20051001:
        kern.polling.enable sysctl MIB is now deprecated. Use ifconfig(8)
        to turn polling(4) on your interfaces.

而這次在長輩的板又看到,於是跑去翻 mailinglist,找到這篇,然後又到處 google 了一下為什麼反而又換回去 polling 模式,在半信半疑當中升上了 7.0 CURRENT 10/1 之後的版本,不過按了 ifconfig sis0 polling 之後竟然不理我。後來才發現原來 kernel 裡面要加上
options   DEVICE_POLLING
才會動,稍微測了一下,非常的出乎意料之外...當時如果有人路過我旁邊大概會覺得這瘋子很奇怪,嘴巴合不起來對螢幕傻笑是怎樣,來看看吧:

sis0: flags=8843 mtu 1500
        options=8
        inet6 fe80::290:ccff:fe73:c148%sis0 prefixlen 64 scopeid 0x1
        inet 192.168.210.254 netmask 0xffffff00 broadcast 192.168.210.255
        ether 00:90:cc:73:c1:48
        media: Ethernet autoselect (100baseTX )
        status: active

lab# ping -f 192.168.210.1
PING 192.168.210.1 (192.168.210.1): 56 data bytes
.^C
--- 192.168.210.1 ping statistics ---
383228 packets transmitted, 383227 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.087/0.310/2.778/0.342 ms

 


last pid:  5249;  load averages:  0.75,  0.51,  0.27                                                 up 0+07:26:32  22:49:40
56 processes:  2 running, 54 sleeping
CPU states:  3.0% user,  0.0% nice, 30.7% system, 24.3% interrupt, 41.9% idle
Mem: 167M Active, 631M Inact, 136M Wired, 31M Cache, 111M Buf, 2328K Free
Swap: 2019M Total, 2019M Free

 

  PID USERNAME  THR PRI NICE   SIZE    RES STATE    TIME   WCPU COMMAND
 5249 root        1  80    0  4644K   892K RUN      0:10  5.22% ping
  595 cookys      1  79    0  6748K  2160K select   0:18  4.49% screen
 4732 cookys      1  78    0 29364K  2932K select   0:12  2.98% sshd
  545 mysql       3  20    0 64484K 49600K kserel   0:20  0.00% mysqld

然後從 192.168.210.1 看 dumeter:


然後換成 Polling

lab# ifconfig sis0 polling
lab# ifconfig
sis0: flags=8843 mtu 1500
        options=48
        inet6 fe80::290:ccff:fe73:c148%sis0 prefixlen 64 scopeid 0x1
        inet 192.168.210.254 netmask 0xffffff00 broadcast 192.168.210.255
        ether 00:90:cc:73:c1:48
        media: Ethernet autoselect (100baseTX )
        status: active
last pid:  5255;  load averages:  0.84,  0.61,  0.35                                                 up 0+07:29:32  22:52:40
56 processes:  2 running, 54 sleeping
CPU states:  0.7% user,  0.0% nice,  0.0% system,  0.0% interrupt, >99.3% idle
Mem: 175M Active, 608M Inact, 136M Wired, 49M Cache, 111M Buf, 2452K Free
Swap: 2019M Total, 2019M Free

  PID USERNAME  THR PRI NICE   SIZE    RES STATE    TIME   WCPU COMMAND
  595 cookys      1  76    0  6748K  2160K select   0:26  0.00% screen
  545 mysql       3  20    0 64484K 49600K kserel   0:20  0.00% mysqld
 4732 cookys      1  76    0 29364K  2932K select   0:14  0.00% sshd
  572 www         1   4    0 92284K 17048K accept   0:06  0.00% httpd
  669 www         1   4    0 93260K 17960K accept   0:05  0.00% httpd
 5255 root        1  76    0  4644K   892K RUN      0:02  0.00% ping

lab# ping -f 192.168.210.1
PING 192.168.210.1 (192.168.210.1): 56 data bytes
.^C
--- 192.168.210.1 ping statistics ---
91551 packets transmitted, 91550 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.292/0.910/0.952/0.022 ms
一樣從 192.168.210.1 看 Dumeter:


CPU load 減輕暴多!不過看 Dumeter 好像比較慢?實際上用 FTP 抓檔測的結果是:沒差啦,用力用吧。不知道啥時會 MFC ,還是把手邊的機器都來衝 7.0-CURRENT? 這樣好像太 XD 了。