Recently the company has done a live project, need to use the WebSocket for communication, and therefore need to test the maximum number of sockets and stability. At the time of this demand, the only thing to think of is jmeter, from Baidu to download the corresponding socket-dependent jar package, began to study (after all, the first time to do this test), worried that a single pressure source is not enough, and the whole distributed, But eventually found that JMeter is not suitable for testing the maximum number of sockets, so adjusted the idea, looking for other methods, Kung fu not pay a conscientious, Finally sent a good socket test gadget (click to download) is an. exe file, using the tool can easily implement the socket stability test, the connection number test is a bit troublesome, because our websocket need to pass some parameters, which involves parameter parameterization, this time to think of automation The use of a tool called AUTOIT3, through the AUTOIT3 call the. exe program to achieve the input of different parameters, you need to prepare the data file: The specific code is as follows:
Run ("E:\webSocket\WebSocket_test\TradePhoneClient.exe") Sleep ( the) winwait ("Form1") $sheet= Gettestsheet ("E:\webSocket\WebSocket_test\student_uuid20000_data.csv",1) for $i=1To801Step1Dim $stu _uid= $sheet. Cells ($i,1). Value Createwebsocketconnect ($stu _uid); MsgBox (4096,"rows read:", $stu _uid) Nextcloseexcel () Func createwebsocketconnect ($stu _uid) Controlsettext ("Form1","","[Class:windowsforms10.edit.app.0.141b42a_r14_ad1;instance:2]","ws://xxxxxxx.cn/broadcast-rest/echo?uuid="& $stu _uid&"&type=student&encryptid=testrenshu2000") Controlclick ("Form1","","[Class:windowsforms10.button.app.0.141b42a_r14_ad1;instance:6]") winwait ("[CLASS: #32770]","",3) Controlclick ("[CLASS: #32770]","","Button1") Endfuncfunc Gettestsheet ($path, $sheetindex) processclose ("EXCEL. EXE") $oExcel= Objcreate ("Excel.Application") $oExcel. Visible=0$workbook=$oExcel. Workbooks.Open ($path) $sheet=$workbook. Worksheets.item ($sheetindex) Return $sheetEndFuncFunc closeexcel () $workbook. Save (); $oExcel. Quit (); Processclose ("EXCEL. EXE"); Force kill process Endfunc
Summary: WebSocket maximum number of connections depends on the maximum number of Tomcat threads, number of system processes/etc/security/limits.d/90-nproc.conf files, general settings 51200
WebSocket WS-Protocol test