iptables 性能 测试
一直研究iptables 性能,這幾天剛好有硬件資源,于是發始下手測試iptables NAT 性……
? 硬件環境 ?:?
? ? ?服務器: IBM x3650 ( 4G ?E5645 6核 12線程) ESXi
? ? ? 測試服務器 ?: Ser1 配置 ( 1.5G 4核心 redhat 6.2 x64 iptables v 1.4)
? ? ? 測試服務器 ?: windows xp (512內存,2核心 ),Endpoint 用
? ? ? ? ? 網絡環境 ?:Gbps
? ? ? ? ? ?測試軟件:業界公認的Ixchariot?
TOP圖
? ? ? ? ?
NAT FORWARD 默認為DROP?
? 生成測試所需要的 iptables 規則,下面貼出生成iptables 腳本:
#!/bin/bash ### ##regard #default output iptables policy file name is "iptables_policy",Please completed renamed #default output mac bandding file name is "mac_policy",please completed renamed ### start_ip=1 end_ip=3000 ip_n=0 ## ip_n is subnet [ example 192.168.iP_n.x ]###---------------------------------------------------------------------------- ### PRIGRAM ###----------------------------------------------------------------------------############## while [ $start_ip -le $end_ip ] # echo "[ $start_ip -gt $end_ip ]"doif [ $start_ip -eq 254 ]thenip_n=$(($ip_n + 1))start_ip=1end_ip=$(($end_ip - 253))#reserve end_ip.254 (SSH control port)fiiptables -A FORWARD -i eth0 -s 192.168.$ip_n.$start_ip -m state --state NEW,ESTABLISHED,RELATED -j ACCEPTecho "#arp -i" '$in_net' " -s 192.168.$ip_n.$start_ip " >> mac_policy##displayecho "#iptables -A FORWARD add 192.168.$ip_n.$start_ip [OK] ; arp -i [ interface ] -s 192.168.$ip_n.$start_ip [OK] "start_ip=$(($start_ip + 1 ))done30k 條規則測試 測試主機ACCEPT 在最后一條,ixchariot 測試結果:
Test Execution (Endpoint 1 to Endpoint 2)
| All Pairs | |||||
| Pair 1 | 192.168.10.249 | 192.168.100.24 | TCP | Throughput.scr |
Throughput
| All Pairs | 81.009 | 52.875 | 94.787 | |||
| Pair 1 | 81.059 | 52.875 | 94.787 | 3.497 | 98.694 | 4.314 |
| Totals: | 81.009 | 52.875 | 94.787 |
服務器使用率:
關于si 、ksoftirqd 等這里就不作解釋。
50k 條規則測試 測試主機ACCEPT 在最后一條,ixchariot 測試結果:
Test Execution (Endpoint 1 to Endpoint 2)
| All Pairs | |||||
| Pair 1 | 192.168.10.249 | 192.168.100.24 | TCP | Throughput.scr |
Throughput
| All Pairs | 78.976 | 60.286 | 94.787 | |||
| Pair 1 | 79.023 | 60.286 | 94.787 | 3.418 | 101.236 | 4.326 |
| Totals: | 78.976 | 60.286 | 94.787 |
服務器性能:
?
把測試主機放在第一條時測試:
?無論是 30k規則還是50k規則
Measured Time (secs) ?< 15 secs
?說明iptables 規則順序與延時有極為重要的關系,稍后附測試數據,與NetBSD 的PF 性能,敬請關注!
總結
以上是生活随笔為你收集整理的iptables 性能 测试的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【原】push过快的错误 (Pushin
- 下一篇: 反射,System.Type类