要开始还债了。
今天整理了一下一套bind9的配置,把记录都清理了一番。想了想,顺带安装了个geoipdns来做性能测试。整理记录的时候用bind-to-tinydns转换了一下记录格式。这些过程以后再说。
NS服务器是同一台Dell PowerEdge 2950。先启动的geoipdns,测试完毕后,停止服务再启动bind9,接着测试。测试时在服务器端跑vmstat 1输出系统状态。
以下就是测试环境的一些基本信息和测试结果。
--------------------------------------------------------------------------------
4个解析记录,每个重复25万次,共计100万条记录。
- [root@client tmp]# wc data.dnsperf
- 1000000 2000000 17500000 data.dnsperf
- [root@client tmp]# sort data.dnsperf | uniq -c
- 250000 smartwork.cn NS
- 250000 smartwork.com.cn NS
- 250000 www.smartwork.cn A
- 250000 www.smartwork.com.cn A
#用fpdns确认一下DNS软件和版本。geoipdns改自tinydns/djbdns,因此显示的是TinyDNS 1.05。
- [root@client tmp]# fpdns 192.168.1.103 smartwork.cn
- fingerprint (192.168.1.103, 192.168.1.103): DJ Bernstein TinyDNS 1.05
#使用bind9自带的queryperf来做测试。服务器IP是192.168.1.103。
- [root@client tmp]# queryperf -d data.dnsperf -s 192.168.1.103
- DNS Query Performance Testing Tool
- Version: $Id: queryperf.c,v 1.1.1.2.2.5.4.4 2006/01/05 02:06:09 marka Exp $
- [Status] Processing input data
- [Status] Sending queries (beginning with 192.168.1.103)
- [Status] Testing complete
- Statistics:
- Parse input file: once
- Ended due to: reaching end of file
- Queries sent: 1000000 queries
- Queries completed: 1000000 queries
- Queries lost: 0 queries
- Queries delayed(?): 0 queries
- RTT max: 0.002220 sec
- RTT min: 0.000176 sec
- RTT average: 0.000471 sec
- RTT std deviation: 0.000058 sec
- RTT out of range: 0 queries
- Percentage completed: 100.00%
- Percentage lost: 0.00%
- Started at: Sun Apr 24 14:33:33 2011
- Finished at: Sun Apr 24 14:33:58 2011
- Ran for: 25.176430 seconds
- Queries per second: 39719.690202 qps
以上测试结果表明geoipdns的QPS接近4万。以下是NS服务器在做测试时的vmstat信息。
- [root@server wip]# vmstat 1
- procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
- r b swpd free buff cache si so bi bo in cs us sy id wa st
- 0 0 7724 66368 884060 1438376 0 0 9 54 2 1 1 1 98 0 0
- 0 0 7724 66368 884060 1438376 0 0 0 0 1012 80 0 0 100 0 0
- 0 0 7724 66192 884060 1438376 0 0 0 0 1053 134 0 0 100 0 0
- 0 0 7724 66192 884064 1438372 0 0 0 28 1060 145 0 0 100 0 0
- 0 0 7724 66192 884064 1438372 0 0 0 0 1068 149 0 0 100 0 0
- 0 0 7724 66192 884072 1438368 0 0 0 324 1055 108 0 0 100 0 0
- 0 0 7724 66192 884072 1438368 0 0 0 0 1063 141 0 0 100 0 0
- 0 0 7724 66316 884076 1438372 0 0 0 148 1077 224 1 1 99 0 0
- 0 0 7724 66316 884084 1438364 0 0 0 64 1030 107 0 0 100 0 0
- 1 0 7724 66440 884112 1438348 0 0 0 1052 7842 22896 8 10 82 0 0
- 1 0 7724 66144 884228 1438332 0 0 0 3900 24090 78624 29 33 38 0 0
- 2 0 7724 66144 884320 1438352 0 0 0 3780 24352 78751 28 35 36 0 0
- 1 0 7724 66092 884472 1438300 0 0 0 3724 24470 78742 30 33 38 0 0
- 1 0 7724 66092 884656 1438352 0 0 0 3644 24362 78867 29 34 38 0 0
- 1 0 7724 65968 884864 1438344 0 0 0 3780 23935 78702 29 34 37 0 0
- 1 0 7724 65844 885036 1438240 0 0 0 4124 23316 77694 28 33 39 0 0
- 1 0 7724 65596 885204 1438372 0 0 0 3640 23685 78494 29 34 38 0 0
- 1 0 7724 65472 885388 1438352 0 0 0 3672 23637 78463 28 35 38 0 0
- 1 0 7724 65224 885556 1438284 0 0 0 3784 23853 78531 29 34 38 0 0
- 1 0 7724 65100 885724 1438316 0 0 0 3640 24140 78854 30 32 38 0 0
- 1 0 7724 65044 885928 1438212 0 0 0 3892 24011 78794 30 32 38 0 0
- 1 0 7724 65044 886096 1438260 0 0 0 3640 24159 78654 28 35 38 0 0
- 1 0 7724 65112 886292 1438164 0 0 0 3920 23326 78904 29 34 37 0 0
- 1 0 7724 65112 886472 1438372 0 0 0 3924 22956 78859 32 31 37 0 0
- 1 0 7724 64988 886644 1438200 0 0 0 3920 23232 79083 29 34 37 0 0
- 1 0 7724 64988 886832 1438140 0 0 0 4340 23479 78165 28 34 38 0 0
- 2 1 7724 64864 887000 1438268 0 0 0 3920 23573 78047 28 34 38 0 0
- 1 0 7724 64740 887184 1438196 0 0 0 3796 23337 77980 29 34 38 0 0
- 1 0 7724 64492 887368 1438304 0 0 0 3924 23617 77948 29 35 36 0 0
- 1 0 7724 64244 887564 1438380 0 0 0 3920 23748 77914 29 33 39 0 0
- 1 0 7724 63820 887724 1438368 0 0 0 3956 23310 78667 29 33 38 0 0
- 1 0 7724 63572 887900 1438396 0 0 0 3920 23414 78926 28 34 37 0 0
- 1 0 7724 63328 888108 1438336 0 0 0 3920 23414 78813 29 34 37 0 0
- 1 0 7724 63080 888296 1438392 0 0 0 3924 23615 78879 29 33 38 0 0
- 0 0 7724 62956 888460 1438376 0 0 0 3360 20485 67866 25 29 46 0 0
- 0 0 7724 62956 888460 1438420 0 0 0 532 1078 121 0 0 100 0 0
- 0 0 7724 62956 888460 1438420 0 0 0 0 1021 96 0 0 100 0 0
- 0 0 7724 62088 888476 1438404 0 0 0 184 1219 282 1 1 99 0 0
- 0 0 7724 62088 888476 1438404 0 0 0 0 1247 115 0 0 100 0 0
- 0 0 7724 62088 888488 1438412 0 0 0 236 1210 133 0 0 100 0 0
- 0 0 7724 61848 888488 1438412 0 0 0 152 1153 149 0 0 100 0 0
- 0 0 7724 61848 888488 1438424 0 0 0 0 1122 93 0 0 100 0 0
--------------------------------------------------------------------------------
把geoipdns服务停掉后,切换成bind9。用的是bind-9.3.6-16.P1.el5,直接yum缺省安装的,未作任何编译。回头做个编译优化版再测试看看。配置方面也会造成一定的性能差异,比如recursion no和yes结果也有200个qps的差异。日志开启和关闭估计也会存在差异。这些细节的地方以后有时间再充分测试吧。
- [root@client tmp]# fpdns 192.168.1.103 smartwork.cn
- fingerprint (192.168.1.103, 192.168.1.103): ISC BIND 9.2.3rc1 -- 9.4.0a0 [recursion enabled]
- [root@client tmp]# queryperf -d data.dnsperf -s 192.168.1.103
- DNS Query Performance Testing Tool
- Version: $Id: queryperf.c,v 1.1.1.2.2.5.4.4 2006/01/05 02:06:09 marka Exp $
- [Status] Processing input data
- [Status] Sending queries (beginning with 192.168.1.103)
- [Status] Testing complete
- Statistics:
- Parse input file: once
- Ended due to: reaching end of file
- Queries sent: 1000000 queries
- Queries completed: 1000000 queries
- Queries lost: 0 queries
- Queries delayed(?): 0 queries
- RTT max: 0.024886 sec
- RTT min: 0.000314 sec
- RTT average: 0.001119 sec
- RTT std deviation: 0.000215 sec
- RTT out of range: 0 queries
- Percentage completed: 100.00%
- Percentage lost: 0.00%
- Started at: Sun Apr 24 14:35:27 2011
- Finished at: Sun Apr 24 14:36:24 2011
- Ran for: 57.228460 seconds
- Queries per second: 17473.823339 qps
以上测试结果显示QPS约为1万8千。相比geoipdns而言差异还是蛮大的。2008年曾经做过一次bind9的测试,当时QPS在2万6千左右。这个跟具体的硬件、系统和应用环境都有相关吧,作为一个相对的参照即可。
以下vmstat结果可以看出bind9对系统的耗用比geoipdns高很多。
- [root@server wip]# vmstat 1
- procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
- r b swpd free buff cache si so bi bo in cs us sy id wa st
- 0 0 7724 63204 886160 1436860 0 0 9 54 2 1 1 1 98 0 0
- 0 0 7724 63204 886160 1436860 0 0 0 608 1049 97 0 0 100 0 0
- 0 0 7724 63204 886160 1436860 0 0 0 0 1107 195 0 0 100 0 0
- 0 0 7724 63204 886168 1436852 0 0 0 72 1047 140 0 0 100 0 0
- 0 0 7724 63204 886172 1436848 0 0 0 24 1027 102 0 0 100 0 0
- 0 0 7724 63204 886172 1436864 0 0 0 0 1032 116 0 0 100 0 0
- 0 0 7724 62904 886172 1436864 0 0 0 40 1036 162 0 0 100 0 0
- 0 0 7724 62904 886172 1436864 0 0 0 0 1019 91 0 0 100 0 0
- 0 0 7724 62908 886172 1436864 0 0 0 0 1019 92 0 0 100 0 0
- 2 0 7724 62536 886184 1437888 0 0 0 16 11493 25180 34 17 49 0 0
- 2 0 7724 60924 886184 1439516 0 0 0 0 18592 42026 59 28 14 0 0
- 2 0 7724 59064 886184 1441292 0 0 0 3724 18599 42150 60 27 14 0 0
- 2 0 7724 57328 886188 1442916 0 0 0 0 18616 41874 60 28 13 0 0
- 2 0 7724 55344 886224 1444660 0 0 0 3620 18615 41023 61 27 13 0 0
- 2 0 7724 53980 886228 1446284 0 0 0 64 18648 41901 57 29 14 0 0
- 2 0 7724 52120 886236 1448080 0 0 0 0 18749 41841 61 26 13 0 0
- 2 0 7724 50208 886236 1449708 0 0 0 2620 18779 41643 58 28 14 0 0
- 2 0 7724 48472 886236 1451344 0 0 0 0 18511 42099 58 27 15 0 0
- 2 0 7724 46804 886256 1453100 0 0 0 8788 18387 41100 59 27 13 2 0
- 2 0 7724 45068 886264 1454860 0 0 0 16 18687 42082 60 28 12 0 0
- 2 0 7724 43332 886268 1456484 0 0 0 0 18686 42110 62 25 14 0 0
- 2 0 7724 41720 886268 1458284 0 0 0 72 18618 42222 58 28 13 0 0
- 2 0 7724 39984 886272 1460056 0 0 0 0 18829 42481 60 27 14 0 0
- 2 0 7724 38248 886272 1461692 0 0 0 8612 18818 42118 62 26 13 1 0
- 2 0 7724 36512 886276 1463464 0 0 0 12 18908 42262 61 26 13 0 0
- 2 0 7724 34776 886280 1465092 0 0 0 0 18851 42304 61 27 12 0 0
- 2 0 7724 33176 886280 1466868 0 0 0 140 18600 42144 59 28 13 0 0
- 2 0 7724 31440 886284 1468496 0 0 0 0 18602 41751 58 28 15 0 0
- 2 0 7724 29720 886284 1470272 0 0 0 8724 18233 41670 58 29 13 0 0
- 2 0 7724 27984 886288 1471904 0 0 0 16 18582 42084 61 27 12 0 0
- 2 0 7724 26124 886292 1473676 0 0 0 0 18561 42201 58 27 15 0 0
- 2 0 7724 24512 886292 1475320 0 0 0 216 18719 42239 59 28 14 0 0
- 2 0 7724 27916 883668 1475384 0 0 0 0 18767 41953 57 30 14 0 0
- 2 0 7724 26304 883672 1477136 0 0 0 8560 18651 41541 59 27 13 1 0
- 2 0 7724 24692 883680 1478904 0 0 0 12 18680 42036 58 27 15 0 0
- 2 0 7724 25776 882324 1479080 0 0 0 0 18631 41786 59 27 15 0 0
- 2 0 7724 24168 882324 1480708 0 0 0 88 18807 41904 60 26 13 0 0
- 1 0 7724 26640 880840 1479644 0 0 0 0 18426 38521 61 27 13 0 0
- 2 0 7724 25152 880840 1481420 0 0 0 8684 18318 36951 61 26 12 0 0
- 2 0 7724 26116 879548 1481784 0 0 0 16 18328 37050 62 26 12 0 0
- 2 0 7724 24380 879548 1483364 0 0 0 0 18364 37044 63 25 12 0 0
- 2 0 7724 25524 877752 1484088 0 0 0 144 18348 36779 62 26 12 0 0
- 2 0 7724 26548 875732 1485068 0 0 0 0 18230 36907 60 27 13 0 0
- procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
- r b swpd free buff cache si so bi bo in cs us sy id wa st
- 2 0 7724 24688 875768 1486436 0 0 0 8776 17000 33880 58 25 18 0 0
- 3 0 7724 26268 873764 1487256 0 0 0 104 18390 37361 62 27 11 0 0
- 3 0 7724 24532 873772 1489140 0 0 0 0 18335 38149 62 27 11 0 0
- 3 0 7724 25932 871680 1490048 0 0 0 332 18393 37829 62 26 13 0 0
- 3 0 7724 24072 871680 1491760 0 0 0 0 18434 38258 62 25 12 0 0
- 2 0 7724 25220 869432 1492776 0 0 0 8704 18088 36291 60 26 12 2 0
- 2 0 7724 27876 866284 1493424 0 0 0 16 18315 37097 62 25 13 0 0
- 2 0 7724 26264 866288 1495200 0 0 0 0 18392 37139 61 26 13 0 0
- 2 0 7724 24528 866288 1497040 0 0 0 240 18332 37139 62 27 12 0 0
- 2 0 7724 25736 864112 1497984 0 0 0 0 18262 36960 61 27 13 0 0
- 2 0 7724 26696 861840 1499112 0 0 0 8552 17889 36269 62 25 12 2 0
- 2 0 7724 25084 861840 1500848 0 0 0 12 18284 37049 60 26 14 0 0
- 2 0 7724 27608 858820 1501516 0 0 0 0 18192 36823 62 26 12 0 0
- 1 0 7724 26184 858820 1503048 0 0 0 112 18321 37226 60 28 12 0 0
- 2 0 7724 24448 858824 1504844 0 0 0 0 18250 37136 61 26 13 0 0
- 2 0 7724 25724 856816 1505720 0 0 0 8684 17908 36170 60 27 12 2 0
- 2 0 7724 24112 856816 1507336 0 0 0 16 18186 37031 61 27 12 0 0
- 2 0 7724 26272 853612 1508020 0 0 0 0 18287 36921 62 26 12 0 0
- 2 0 7724 24536 853612 1509816 0 0 0 120 18316 36936 62 26 12 0 0
- 2 0 7724 25804 851700 1510496 0 0 0 0 18292 36821 60 26 13 0 0
- 2 0 7724 24192 851700 1512328 0 0 0 8504 18256 36773 62 26 13 0 0
- 2 0 7724 25216 849680 1513164 0 0 0 12 18314 36674 61 26 12 0 0
- 1 0 7724 26300 847532 1514236 0 0 0 0 18403 36930 62 27 12 0 0
- 0 0 7724 25804 847532 1515124 0 0 0 112 10584 20344 34 14 52 0 0
- 0 0 7724 25804 847532 1515232 0 0 0 0 1102 194 0 0 100 0 0
- 0 0 7724 25500 847536 1515228 0 0 0 5720 1105 155 0 1 99 0 0
- 0 0 7724 25500 847544 1515220 0 0 0 16 1021 92 0 0 100 0 0
- 0 0 7724 25500 847544 1515220 0 0 0 0 1016 84 0 0 100 0 0
- 0 0 7724 25500 847544 1515220 0 0 0 168 1044 100 0 0 100 0 0
- 0 0 7724 25500 847544 1515220 0 0 0 0 1069 142 0 0 100 0 0
- 1 0 7724 25520 845616 1514428 0 0 0 224 1407 1228 8 6 87 0 0
- 0 0 7724 25520 845624 1514420 0 0 0 72 1832 4818 20 15 65 0 0
- 0 0 7724 25520 845624 1514328 0 0 0 0 1884 3013 20 16 65 0 0
- 1 0 7724 25524 845624 1514328 0 0 0 132 1866 3534 21 15 65 0 0
- 1 0 7724 25524 845624 1514328 0 0 0 0 1843 7252 20 15 65 0 0
基本结论:geoipdns性能比bind9强,资源耗用比bind9低,便宜量又足,我很喜爱它!
geoipdns正是因为实现了智能解析,所以我才要打算放弃bind9的。迟迟未动手主要是因为资源数据格式学习成本有点高,还有待熟悉。打算找个管理程序或者自己写一个,这样子就不用去头疼了。鉴于某些特殊情况,最终还是得熟悉这个玩意儿的记录数据格式的。
追加:dnsmasq做dns cache的性能测试。
使用dnsmasq做测试,fpdns侦测出来的实际上是其所指向的上游NS的信息:
- [root@client tmp]# fpdns 192.168.1.103 smartwork.cn
- fingerprint (192.168.1.103, 192.168.1.103): ISC BIND 9.2.3rc1 -- 9.4.0a0 [recursion enabled]
- [root@client tmp]# queryperf -d data.dnsperf -s 192.168.1.103
- DNS Query Performance Testing Tool
- Version: $Id: queryperf.c,v 1.1.1.2.2.5.4.4 2006/01/05 02:06:09 marka Exp $
- [Status] Processing input data
- [Status] Sending queries (beginning with 192.168.1.103)
- [Status] Testing complete
- Statistics:
- Parse input file: once
- Ended due to: reaching end of file
- Queries sent: 1000000 queries
- Queries completed: 1000000 queries
- Queries lost: 0 queries
- Queries delayed(?): 0 queries
- RTT max: 0.186884 sec
- RTT min: 0.000023 sec
- RTT average: 0.000926 sec
- RTT std deviation: 0.001214 sec
- RTT out of range: 0 queries
- Percentage completed: 100.00%
- Percentage lost: 0.00%
- Started at: Sun Apr 24 17:17:02 2011
- Finished at: Sun Apr 24 17:17:52 2011
- Ran for: 49.239154 seconds
- Queries per second: 20309.041053 qps
- [root@server wip]# vmstat 1
- procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
- r b swpd free buff cache si so bi bo in cs us sy id wa st
- 0 0 7724 84472 628420 1680224 0 0 9 54 0 0 1 1 98 0 0
- 0 0 7724 84416 628420 1680224 0 0 0 312 1101 168 0 0 100 0 0
- 0 0 7724 84420 628424 1680228 0 0 0 56 1024 141 0 0 100 0 0
- 0 0 7724 84368 628424 1680228 0 0 0 0 1032 112 0 0 100 0 0
- 0 0 7724 84492 628432 1680228 0 0 0 128 1040 115 0 0 100 0 0
- 0 0 7724 84492 628432 1680228 0 0 0 0 1084 165 0 0 100 0 0
- 0 0 7724 84492 628432 1680228 0 0 0 288 1048 90 0 0 100 0 0
- 0 0 7724 84492 628432 1680228 0 0 0 16 1085 188 0 0 100 0 0
- 0 0 7724 84492 628432 1680228 0 0 0 36 1095 191 0 0 100 0 0
- 0 0 7724 84368 628444 1680216 0 0 0 152 1185 342 0 1 98 0 0
- 1 0 7724 83624 628444 1680232 0 0 0 0 20796 13820 4 21 75 0 0
- 1 0 7724 81024 628444 1680232 0 0 0 228 29654 19716 7 29 64 0 0
- 1 0 7724 79292 628452 1680232 0 0 0 104 28962 19472 7 29 64 0 0
- 1 0 7724 77808 628452 1680232 0 0 0 0 24124 15843 6 24 71 0 0
- 1 0 7724 76080 628460 1680232 0 0 0 276 29618 19708 7 28 65 0 0
- 1 0 7724 74716 628460 1680232 0 0 0 0 28938 19534 6 30 63 0 0
- 1 0 7724 73476 628460 1680232 0 0 0 232 28226 19787 6 30 65 0 0
- 1 0 7724 72484 628464 1680228 0 0 0 16 29158 19356 6 29 65 0 0
- 1 0 7724 71616 628464 1680232 0 0 0 16 28305 19036 7 27 66 0 0
- 1 0 7724 70872 628464 1680232 0 0 0 0 29394 19660 6 30 63 0 0
- 1 0 7724 70128 628464 1680232 0 0 0 0 29668 19403 8 29 64 0 0
- 1 0 7724 69636 628464 1680232 0 0 0 24 29746 19801 7 30 62 0 0
- 1 0 7724 69020 628472 1680232 0 0 0 12 29816 19291 7 30 63 0 0
- 1 0 7724 68716 628472 1680232 0 0 0 0 29703 19492 8 29 63 0 0
- 1 0 7724 68344 628472 1680232 0 0 0 0 29409 19589 6 29 65 0 0
- 1 0 7724 68096 628472 1680232 0 0 0 0 29133 19465 8 29 63 0 0
- 1 0 7724 67848 628480 1680232 0 0 0 400 28700 19469 7 29 64 0 0
- 1 0 7724 67600 628488 1680224 0 0 0 16 29900 19523 7 30 64 0 0
- 1 0 7724 67352 628488 1680232 0 0 0 32 30361 19400 6 31 64 0 0
- 1 0 7724 67228 628488 1680232 0 0 0 0 30169 19721 7 30 63 0 0
- 1 0 7724 67104 628488 1680236 0 0 0 0 29991 19143 7 31 62 0 0
- 1 0 7724 66984 628488 1680236 0 0 0 32 30033 19379 6 30 63 0 0
- 1 0 7724 66804 628492 1680236 0 0 0 12 29975 19214 8 30 62 0 0
- 1 0 7724 66748 628492 1680236 0 0 0 0 30038 19505 6 30 63 0 0
- 1 0 7724 66748 628492 1680236 0 0 0 0 30597 19149 7 29 64 0 0
- 1 0 7724 66624 628492 1680236 0 0 0 0 31624 18856 7 30 63 0 0
- 1 0 7724 66624 628492 1680236 0 0 0 604 31463 18502 8 30 62 0 0
- 1 0 7724 66500 628492 1680236 0 0 0 16 31394 18333 8 29 62 0 0
- 1 0 7724 66500 628492 1680236 0 0 0 16 31265 18492 7 30 63 0 0
- 1 0 7724 66004 628516 1680212 0 0 0 132 31094 18832 9 29 62 0 0
- 1 0 7724 66004 628516 1680236 0 0 0 0 31016 18792 6 32 62 0 0
- 1 0 7724 65884 628516 1680236 0 0 0 112 31025 18911 7 30 63 0 0
- 1 0 7724 65764 628520 1680236 0 0 0 64 31147 18236 6 31 63 0 0
- procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
- r b swpd free buff cache si so bi bo in cs us sy id wa st
- 2 0 7724 65768 628520 1680236 0 0 0 0 31745 18293 7 31 62 0 0
- 1 0 7724 65768 628536 1680236 0 0 0 84 29068 17584 7 28 66 0 0
- 1 0 7724 65768 628536 1680236 0 0 0 0 30786 18727 8 30 63 0 0
- 1 0 7724 65768 628540 1680236 0 0 0 272 32805 18427 8 31 61 0 0
- 1 0 7724 65768 628544 1680232 0 0 0 16 31616 18416 6 31 63 0 0
- 1 0 7724 65768 628548 1680232 0 0 0 32 31661 18688 7 30 62 0 0
- 1 0 7724 65768 628548 1680232 0 0 0 0 28929 17536 7 27 66 0 0
- 1 0 7724 65768 628548 1680240 0 0 0 0 31367 18563 8 30 62 0 0
- 1 0 7724 65772 628548 1680240 0 0 0 104 32377 18049 7 32 62 0 0
- 1 0 7724 65776 628556 1680240 0 0 0 12 31386 18477 8 30 63 0 0
- 1 0 7724 65720 628556 1680240 0 0 0 0 30877 18950 7 30 64 0 0
- 1 0 7724 65720 628556 1680240 0 0 0 0 31808 18464 7 31 63 0 0
- 1 0 7724 65720 628556 1680240 0 0 0 0 32712 18096 8 32 60 0 0
- 1 0 7724 65720 628556 1680240 0 0 0 252 31589 18404 8 29 63 0 0
- 1 0 7724 65720 628560 1680236 0 0 0 16 32304 18464 6 32 62 0 0
- 1 0 7724 65720 628564 1680236 0 0 0 32 31779 18424 6 32 63 0 0
- 0 0 7724 65720 628564 1680236 0 0 0 0 16244 8820 4 15 82 0 0
- 0 0 7724 65720 628564 1680244 0 0 0 0 1059 143 0 0 100 0 0
- 0 0 7724 65792 628564 1680244 0 0 0 68 1121 199 0 0 100 0 0
- 0 0 7724 65736 628564 1680244 0 0 0 12 1031 153 0 0 100 0 0
- 0 0 7724 65748 628564 1680244 0 0 0 0 1044 127 0 0 100 0 0
- 0 0 7724 65748 628564 1680244 0 0 0 0 1031 105 0 0 100 0 0
- 0 0 7724 65748 628564 1680244 0 0 0 0 1047 125 0 0 100 0 0
- 0 0 7724 65872 628568 1680244 0 0 0 396 1105 167 0 0 100 0 0
- 0 0 7724 65872 628576 1680236 0 0 0 16 1082 177 0 0 100 0 0
- 0 0 7724 65872 628576 1680244 0 0 0 20 1069 155 0 0 100 0 0
- 0 0 7724 65624 628596 1680224 0 0 0 152 1403 309 1 1 98 0 0
从queryperf的结果看,dnsmasq做dns cache时QPS达到2万多,但是服务器端压力比geoipdns和bind9都轻松。实际上这也是从2008年开始我在做web cache server时把dnsmasq作为标配的原因,解决了squid的dns_children过载的问题,也极大缓解了系统压力。在web cache架构的课程中也跟学员讲过一定要把dnsmasq作为标配。当然了,dnsmasq里边还是要把cache-size设得很大才行,默认的在大压力下很容易查询超时。
20110425补充: 用dns cache的时候可以顺便检查一下上游NS的压力,这样就知道对权威NS的压力卸载有多大作用了。当然了,客户端上安装dnsmasq做为DNS正向代理是比较好的,如果在权威NS端做DNS反向代理用,智能解析就有问题了——除非从代码底层做修改,让dns cache有智能查询和缓存功能。可这又何苦呢!
2011.04.24/北京
--------------------------------------------------------------------------------