Websocket Stress Test With Autobahn Testsuite
I try to do some stress test against my websocket server. On client side I run the following script from this site : import time, sys from twisted.internet import defer, reactor
Solution 1:
The massconnect.py
script you used was supposed to be invoked from another part of the autobahntestsuite, such as the wstest
command:
$ echo '{"servers": [{"name": "test", "uri":"ws://127.0.0.1:8080"} ], "options": {"connections": 1000,"batchsize": 500, "batchdelay": 1000, "retrydelay": 200 }}' > spec.json
$ wstest -m massconnect --spec spec.json
If you want to copy massconnect
directly, I think it's missing the command to start the Twisted deferred tasks:
if __name__ == '__main__':
spec = {}
spec['servers'] = [{'name': 'test', 'uri':"ws://127.0.0.1:8080"} ]
spec['options'] ={'connections': 1000,'batchsize': 500, 'batchdelay': 1000, 'retrydelay': 200 }
startClient(spec,False)
reactor.run() # <-- add this
And check your Python indentations, either some of them got corrupted when pasting here, or the original code had incorrect indentations in some class and function definitions.
Post a Comment for "Websocket Stress Test With Autobahn Testsuite"