Hadyai Internet R&D LAB

ผลงานของ Hadyai Internet R&D LAB => คุยกับทีมวิจัย => ข้อความที่เริ่มโดย: admin ที่ 30 มีนาคม 2009, 14:24:17

หัวข้อ: วิธีทดสอบประสิทธิภาพของระบบเครือข่าย LAN
เริ่มหัวข้อโดย: admin ที่ 30 มีนาคม 2009, 14:24:17
เนื่องจากมีหลายท่าน ถามผมมาว่า จะวางระบบในร้านเป็น Gigabit ควรใช้ Switch หรืออุปกรณ์ยี่ห้อไหนดี  อันนี้เป็นคำถามที่

ยอดฮิตมากที่ถามมา ผมก็ตอบตามตรงนะครับ แบ่ง Gigabit Switch ออกเป็น 3 กลุ่มใหญ่ ๆ ด้วยกัน คือ

1. L2 Unmanage Gigabit Switch
2. L2 Manage Gigabit Switch
3. L3 Manage Gigabit Switch

ซึ่งส่วนใหญ่แล้ว ที่เราซื้อมาใช้ ๆ กัน จะเป็นแบบที่ 1 คือ L2 Unmanage Gigabit Switch เนื่องด้วยเหตุผลที่ว่า อีก 2 แบบนั้น

ราคาสูงมาก ๆ

สำหรับแบบแรกนั้น L2 Unmanage Gigabit Switch ในแต่ละยี่ห้อนั้น คุณภาพก็ไม่ได้แตกต่างกันมากนัก แต่สิ่งสำคัญอยู่ที่ว่า

เราสามารถเปิดการใช้งานของฟังก์ชั่นต่าง ๆ ที่มีอยู่ใน Switch ตัวนั้น มาใช้งานได้หรือไม่ และอุปกรณ์ประกอบอื่น ๆ มันรอง

รับกับฟังก์ชั่นนั้นหรือไม่ ทั้งในตัวสาย ตัว LAN Card หรือ LAN Onboard รวมกระทั่ง การปรับแต่ง Windows ให้รองรับ

ด้วย ซึ่งเป็นสิ่งสำคัญมากกว่า

ในหัวข้อแรก จะพูดถึง การทดสอบประสิทธิภาพของ Gigabit Network กันก่อน เอาแบบง่าย ๆ นะครับ

ไฟล์ DVD สัก 4GB ถ้าทำการก๊อปปี้ผ่านเครือข่าย Gigabit จะใช้เวลานานเท่าไหร่

ในทางทฤษฏี เครือข่าย Gigabit จะรับส่งข้อมูลในปริมาณ 1Gigabit/sec หรือ 1,000,000,000 bit ต่อวินาที หรือ

หนึ่งพันล้านบิตต่อวินาที หรือ เทียบเป็น Byte ก็จะได้เท่ากับ 125MB/sec

ดังนั้นไฟล์ขนาด 4GB จะใช้เวลา 4096/125 = ประมาณ 33 วินาที

แต่ในทางปฏิบัตินั้น จะใช้เวลาประมาณ 2 นาทีกว่า ทำไมถึงเป็นเช่นนั้น (ลองทดสอบกันดูนะครับ)

เราจะทราบได้อย่างไรว่า Gigabit Network ของเรา วิ่งด้วยความเร็วเท่าไหร่

การก๊อปปี้ไฟล์ก็เป็นการทดสอบอย่างหนึ่ง แต่อาจจะเกิดการหน่วงเพราะความเร็วของ HDD ไม่พอ

ผมเลยแนะนำ Tools ตัวนึง ที่ใช้ในการทดสอบความเร็วในการรับส่งข้อมูลผ่านเครื่อข่าย เรียกว่า iperf

สำหรับบน Windows สามารถ Download ได้ที่

http://www.noc.ucf.edu/Tools/Iperf/iperf.exe

สำหรับบน Ubuntu สามารถ ใช้คำสั่ง apt-get install iperf  ได้เลย

วิธีการทดสอบก็คือ ให้ติดตั้งตัวโปรแกรมทดสอบทั้งสองฝั่ง  ฝั่งนึงให้เป็น Server อีกฝั่งให้เป็น Client แล้วใช้คำสั่งทดสอบ

ดังนี้

ฝั่ง Server ใช้คำสั่ง    iperf  -s

ฝั่ง Client ใช้คำสั่ง    iperf  -c  แล้วตามด้วย ip ฝั่ง server

จะได้ผลลัพธ์ออกมาเช่น

ฝั่ง Server

C:\>iperf.exe -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 8.00 KByte (default)
------------------------------------------------------------
[1860] local 192.168.200.100 port 5001 connected with 192.168.200.101 port 1742
[ ID] Interval       Transfer     Bandwidth
[1860]  0.0-10.0 sec   242 MBytes   202 Mbits/sec

ฝั่ง Client

C:\>iperf.exe -c 192.168.200.100
------------------------------------------------------------
Client connecting to 192.168.200.100, TCP port 5001
TCP window size: 8.00 KByte (default)
------------------------------------------------------------
[1912] local 192.168.200.101 port 1742 connected with 192.168.200.100 port 5001
[ ID] Interval       Transfer     Bandwidth
[1912]  0.0-10.0 sec   242 MBytes  202 Mbits/sec

ทำไมถึงเป็นเช่นนั้น  ???

หัวข้อ: Re: วิธีทดสอบประสิทธิภาพของระบบเครือข่าย LAN
เริ่มหัวข้อโดย: admin ที่ 30 มีนาคม 2009, 18:04:58
เพิ่มเติมอีกนิดนึง

ใช้ Switch ตัวเดียวกัน แต่ทดสอบผ่าน Ubuntu Server ไปยัง Ubuntu Server

ผลได้ดังนี้ครับ

Server :

root@Server:~# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.200.1 port 5001 connected with 192.168.200.254 port 36883
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec  1.10 GBytes    939 Mbits/sec

Client :

root@Client:~# iperf -c 192.168.200.1
------------------------------------------------------------
Client connecting to 192.168.200.1, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.200.254 port 36883 connected with 192.168.200.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.10 GBytes    941 Mbits/sec

ทำไมถึงเป็นเช่นนั้น  ??? ??? ???

หัวข้อ: Re: วิธีทดสอบประสิทธิภาพของระบบเครือข่าย LAN
เริ่มหัวข้อโดย: nakri ที่ 30 มีนาคม 2009, 18:09:04
นั่งแถวหน้า  รออาจารย์สอนต่อ..ครับ
หัวข้อ: Re: วิธีทดสอบประสิทธิภาพของระบบเครือข่าย LAN
เริ่มหัวข้อโดย: rocket ที่ 30 มีนาคม 2009, 18:12:59
ดูเหมือน ตัว windows มันวิ่งแค่ 100 Mbits/sec แบบ Duplex รึเปล่าครับ
เฉลยเลยครับ รอฟังอยู่ครับ  ???  ???
หัวข้อ: Re: วิธีทดสอบประสิทธิภาพของระบบเครือข่าย LAN
เริ่มหัวข้อโดย: o3cyber ที่ 30 มีนาคม 2009, 18:18:56
 :)รอนั่งแถวสองติวเข้มครับ ;D
หัวข้อ: Re: วิธีทดสอบประสิทธิภาพของระบบเครือข่าย LAN
เริ่มหัวข้อโดย: SAYHINET ที่ 30 มีนาคม 2009, 18:40:11
 :o :o :o :o
หัวข้อ: Re: วิธีทดสอบประสิทธิภาพของระบบเครือข่าย LAN
เริ่มหัวข้อโดย: hutcomputer ที่ 30 มีนาคม 2009, 19:03:46
รอคำตอบ เช่นกันครับ  ;D
หัวข้อ: Re: วิธีทดสอบประสิทธิภาพของระบบเครือข่าย LAN
เริ่มหัวข้อโดย: jorjae ที่ 30 มีนาคม 2009, 22:59:09
สุดยอดเช่นเคย รอคำตอบเช่นกันครับ
หัวข้อ: Re: วิธีทดสอบประสิทธิภาพของระบบเครือข่าย LAN
เริ่มหัวข้อโดย: admin ที่ 31 มีนาคม 2009, 10:48:27
ทำไม ไม่มีผลการทดสอบของแต่ละร้านเลยหนอ

เด๋วมาต่อให้ครับ ใบ้ให้ว่า ลองปรับแต่งค่า TCP Window Size ดูครับ

โดยใช้พารามิเตอร์  -w  เพิ่มเข้าไปทั้ง Client และ Server เช่น

iperf -s -w 16k

iperf -c 192.168.200.100 -w 16k

เป็นต้น

ลองปรับแต่ง โดยเพิ่มเป็น 16k , 32k , 64k ,  128k , 1m , 2m , 4m

แล้วดูค่า b/w ที่ได้ กับ process ของ cpu ดูนะครับ
หัวข้อ: Re: วิธีทดสอบประสิทธิภาพของระบบเครือข่าย LAN
เริ่มหัวข้อโดย: rocket ที่ 31 มีนาคม 2009, 16:19:25
ลองแล้วครับ  เพิ่ม Windows Size ของผมจาก Default 8K ไป 128K Bandwidth พุ่งจาก 500Mbits/sec ไป 940Mbits/sec    CPU  จาก 18% ไป 40% เลย   :o

หัวข้อ: Re: วิธีทดสอบประสิทธิภาพของระบบเครือข่าย LAN
เริ่มหัวข้อโดย: ★2@nswεr^^★™` ที่ 31 มีนาคม 2009, 18:25:04
ไม่แปลกเรยที่ clonezilla ถึงแรงจัง อิอิ
หัวข้อ: Re: วิธีทดสอบประสิทธิภาพของระบบเครือข่าย LAN
เริ่มหัวข้อโดย: abiz ที่ 31 มีนาคม 2009, 21:28:10
ของผม switch 10/100 ได้แค่ 80 กว่า ถึง 90 กว่า ๆ เองครับ น้อยสุด ๆ
หัวข้อ: Re: วิธีทดสอบประสิทธิภาพของระบบเครือข่าย LAN
เริ่มหัวข้อโดย: mis ที่ 03 เมษายน 2009, 17:32:51
แบบปกติของผมได้ 375 แต่พอปรับ -w 64k ได้ 925 เลย
ถ้าจะปรับถาวรจะมีผลเสียต่อเครื่องไหมครับ และปรับยังไง
หัวข้อ: Re: วิธีทดสอบประสิทธิภาพของระบบเครือข่าย LAN
เริ่มหัวข้อโดย: explosive ที่ 03 เมษายน 2009, 18:18:27
มันคือการปรับแต่งค่า tcp ของ windows เหรอครับ
หัวข้อ: Re: วิธีทดสอบประสิทธิภาพของระบบเครือข่าย LAN
เริ่มหัวข้อโดย: หนุ่มพริ้ว ที่ 03 เมษายน 2009, 23:31:04
ถ้าต้องจัดการกับข้อมูลขนาดใหญ่ขึ้นก็ต้องใช้แรง CPU มากขึ้น เช่นเดียวกับ SmartDisk หรือ Diskless อื่นๆ จำนวน Client ที่มากขึ้น ยิ่งต้องการ CPU ที่เร็วขึ้น ดีขึ้น เช่น CPU ที่เป็น Quad Core อย่างนี้หรือเปล่าครับ
หัวข้อ: Re: วิธีทดสอบประสิทธิภาพของระบบเครือข่าย
เริ่มหัวข้อโดย: -nusz- ที่ 04 เมษายน 2009, 03:51:57
ลองปรับดูแบบนี้แล้วได้ผลอย่างไรบอกกันด้วยน่ะครับ



Procedure for raising network limits for Windows XP (and Windows 2000)
The easiest way to tune TCP under Windows XP (and many earlier versions of windows) is to get DrTCP from "DSL Reports" [download page]. Set the "Tcp receive window" to your computed BDP (e.g. 400000), turn on "Window Scaling" and "Selective Acks". If you expect to use 90 Mb/s or faster, you should also turn on "Time Stamping". You must restart for the changes to take effect.

If you need to get down in the details, you have to use the 'regedit' utility to read and set system parameters. If you are not familiar with regedit you may want to follow the step-by-step instructions [here].

BEWARE: Mistakes with regedit can have very serious consequences that are difficult to correct. You are strongly encouraged to backup the entire registry before you start (use the backup utility) and to export the Tcpip\Parameter subtree to a file, so you can put things back if you need to (use "export" under regedit).

The primary TCP tuning parameters appear in the registry under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters.

To enable high performance TCP you must turn on RFC1323 features (create REG_DWORD key "Tcp1323Opts" with value 3) and set the maximum TCP buffersize (create REG_DWORD key "GlobalMaxTcpWindowSize" with an appropriate value such as 4000000, decimal).

If you want to set the system wide default buffer size create REG_DWORD key "TcpWindowSize" with an appropriate value. This parameter can also be set per interface at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interface\interfaceGUID, which may help to protect interactive applications that are using different interfaces from the effects of overbuffering.

For the most up to date detailed technical information, go to the Microsoft knowledge base (at support.microsoft.com) and search product "windows XP" for "TCP/IP performance tuning".

Speedguide summarizes this material with an intermediate level of detail, however the target audience is for relatively low data rates.

There is also very good page on tuning Windows XP, by Carl Harris at Virginia Tech.

Contributors: Jim Miller (at PSC).
Checked for WindowsXP service pack 2, July 2006


--------------------------------------------------------------------------------



ที่มา : http://www.psc.edu/networking/projects/tcptune/
หัวข้อ: Re: วิธีทดสอบประสิทธิภาพของระบบเครือข่าย LAN
เริ่มหัวข้อโดย: snes ที่ 28 กรกฎาคม 2009, 22:38:30
ผมดูใน xp sp3 มันไม่มีค่านี้คับ เราต้องเพิ่มเข้าไปใช่ไหมคับ ขอบคุณคับ