observing / thor

The WebSocket god of thunder
MIT License
1.29k stars 154 forks source link

Could not establish any connection #30

Open memoryonrepeat opened 8 years ago

memoryonrepeat commented 8 years ago

Hi, I tried to use thor for stress testing my socket.io 1.3.5 server but it doesn't seem to be able to establish the connection even with the least amount possible. This is the log:

➜  ~ thor --amount 1 ws://localhost:6001/

Thor:                                                  version: 1.0.0

God of Thunder, son of Odin and smasher of WebSockets!

Thou shall:
- Spawn 4 workers.
- Create all the concurrent/parallel connections.
- Smash 1 connections with the mighty Mjölnir.

The answers you seek shall be yours, once I claim what is mine.

Connecting to ws://localhost:6001/

Online               188 milliseconds
Time taken           188 milliseconds
Connected            0
Disconnected         0
Failed               1
Total transferred    0B
Total received       0B

Durations (ms):

                     min     mean     stddev  median max
Handshaking          NaN     NaN         NaN     NaN NaN
Latency              NaN     NaN         NaN     NaN NaN

Percentile (ms):

                      50%     66%     75%     80%     90%     95%     98%     98%    100%
Handshaking          NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN
Latency              NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN

Received errors:

1x                   read ECONNRESET

I also tried with a more detailed websocket url, result is the same:

➜  ~ thor --amount 1 ws://localhost:6001/socket.io/?EIO=3&transport=websocket
[1] 99052
➜  ~
Thor:                                                  version: 1.0.0

God of Thunder, son of Odin and smasher of WebSockets!

Thou shall:
- Spawn 4 workers.
- Create all the concurrent/parallel connections.
- Smash 1 connections with the mighty Mjölnir.

The answers you seek shall be yours, once I claim what is mine.

Connecting to ws://localhost:6001/socket.io/?EIO=3

Online               184 milliseconds
Time taken           184 milliseconds
Connected            0
Disconnected         0
Failed               1
Total transferred    0B
Total received       0B

Durations (ms):

                     min     mean     stddev  median max
Handshaking          NaN     NaN         NaN     NaN NaN
Latency              NaN     NaN         NaN     NaN NaN

Percentile (ms):

                      50%     66%     75%     80%     90%     95%     98%     98%    100%
Handshaking          NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN
Latency              NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN

Received errors:

1x                   read ECONNRESET

[1]  + 99052 done       thor --amount 1 ws://localhost:6001/socket.io/?EIO=3

Any idea what could have gone wrong and what should I look into ? Thanks

3rd-Eden commented 8 years ago

Thats probably because Socket.IO requires a HTTP handshake in order to get a session id which is used to establish the real-time connection afterwards.

sesm commented 8 years ago

@tienthanh8490 To test Socket.IO server you could use a different websocket benchmark tool, for example this: https://github.com/M6Web/websocket-bench