日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

iptables 性能 测试

發布時間:2023/12/20 编程问答 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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 ))done

30k 條規則測試 測試主機ACCEPT 在最后一條,ixchariot 測試結果:

Test Execution (Endpoint 1 to Endpoint 2)


Group/ PairEndpoint 1Endpoint 2Network ProtocolService QualityScript/Stream Name
All Pairs
Pair 1192.168.10.249192.168.100.24TCP Throughput.scr


Throughput


Group/ PairAverage (Mbps)Minimum (Mbps)Maximum (Mbps)Throughput 95% Confidence IntervalMeasured Time (secs)Relative Precision
All Pairs81.00952.87594.787
Pair 181.05952.87594.7873.49798.6944.314
Totals:81.00952.87594.787


服務器使用率:


關于si 、ksoftirqd 等這里就不作解釋。


50k 條規則測試 測試主機ACCEPT 在最后一條,ixchariot 測試結果:

Test Execution (Endpoint 1 to Endpoint 2)


Group/ PairEndpoint 1Endpoint 2Network ProtocolService QualityScript/Stream Name
All Pairs
Pair 1192.168.10.249192.168.100.24TCP Throughput.scr


Throughput


Group/ PairAverage (Mbps)Minimum (Mbps)Maximum (Mbps)Throughput 95% Confidence IntervalMeasured Time (secs)Relative Precision
All Pairs78.97660.28694.787
Pair 179.02360.28694.7873.418101.2364.326
Totals:78.97660.28694.787


服務器性能:

?


把測試主機放在第一條時測試:

?無論是 30k規則還是50k規則

Measured Time (secs) ?< 15 secs

?說明iptables 規則順序與延時有極為重要的關系,稍后附測試數據,與NetBSD 的PF 性能,敬請關注!


總結

以上是生活随笔為你收集整理的iptables 性能 测试的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。