Skip to content
This repository has been archived by the owner on Oct 10, 2018. It is now read-only.

Its not closing opened ports after its done #42

Open
kksharma1618 opened this issue Mar 31, 2016 · 0 comments
Open

Its not closing opened ports after its done #42

kksharma1618 opened this issue Mar 31, 2016 · 0 comments

Comments

@kksharma1618
Copy link

Run this command to get opened port

netstat -an | grep -e tcp -e udp | wc -l

Then run load test, eg:

websocket-bench -t primus -p websockets -a 2000 -c 100 -v -w 1 ws://xxx.xxx.xxx.xxx:80

Then again check your open ports using above command (After load test is done completely).
You will find that roughly 2000 ports have been opened and not closed since last run of this command.

If I run load test multiple times I start getting

Primus Worker error{"code":"EADDRNOTAVAIL","errno":"EADDRNOTAVAIL","syscall":"connect","target":{"domain":null,"_events":{},"_maxListeners":10,"_socket":null,"_ultron":null,"_closeReceived":false,"bytesReceived":0,"readyState":3,"supports":{"binary":true},"extensions":null,"_isServer":false,"url":"ws://xxx.xxx.xxx.xxx:80/primus","protocolVersion":13,"binaryType":"arraybuffer","_closeTimer":null}}

Example from my machine:

[[email protected] home]$ netstat -an | grep -e tcp -e udp | wc -l
20
[[email protected] home]$ netstat -an | grep -e tcp -e udp | wc -l
20
[[email protected] home]$ netstat -an | grep -e tcp -e udp | wc -l
20
[[email protected] home]$ netstat -an | grep -e tcp -e udp | wc -l
20
[[email protected] home]$ websocket-bench -t primus -p websockets -a 2000 -c 100 -v -w 1 ws://xxx.xxx.xxx.xxx:80
Launch bench with 2000 total connection, 100 concurent connection
0 message(s) send by client
1 worker(s)
WS server : primus
Benchmark Options {"generatorFile":"/usr/lib/node_modules/websocket-bench/lib/generator.js","type":"primus","transport":"websockets","verbose":true}
trying : 100 ...
trying : 200 ...
trying : 300 ...
trying : 400 ...
trying : 500 ...
trying : 600 ...
trying : 700 ...
trying : 800 ...
trying : 900 ...
trying : 1000 ...
trying : 1100 ...
trying : 1200 ...
trying : 1300 ...
trying : 1400 ...
trying : 1500 ...
trying : 1600 ...
trying : 1700 ...
trying : 1800 ...
trying : 1900 ...
trying : 2000 ...

#### steps report ####
┌────────┬─────────────┬────────┬──────────────┐
│ Number │ Connections │ Errors │ Duration(ms) │
├────────┼─────────────┼────────┼──────────────┤
│ 100    │ 100         │ 0      │ 598          │
├────────┼─────────────┼────────┼──────────────┤
│ 200    │ 100         │ 0      │ 523          │
├────────┼─────────────┼────────┼──────────────┤
│ 300    │ 100         │ 0      │ 505          │
├────────┼─────────────┼────────┼──────────────┤
│ 400    │ 100         │ 0      │ 509          │
├────────┼─────────────┼────────┼──────────────┤
│ 500    │ 100         │ 0      │ 506          │
├────────┼─────────────┼────────┼──────────────┤
│ 600    │ 100         │ 0      │ 509          │
├────────┼─────────────┼────────┼──────────────┤
│ 700    │ 100         │ 0      │ 516          │
├────────┼─────────────┼────────┼──────────────┤
│ 800    │ 100         │ 0      │ 505          │
├────────┼─────────────┼────────┼──────────────┤
│ 900    │ 100         │ 0      │ 505          │
├────────┼─────────────┼────────┼──────────────┤
│ 1000   │ 100         │ 0      │ 513          │
├────────┼─────────────┼────────┼──────────────┤
│ 1100   │ 100         │ 0      │ 507          │
├────────┼─────────────┼────────┼──────────────┤
│ 1200   │ 100         │ 0      │ 506          │
├────────┼─────────────┼────────┼──────────────┤
│ 1300   │ 100         │ 0      │ 507          │
├────────┼─────────────┼────────┼──────────────┤
│ 1400   │ 100         │ 0      │ 505          │
├────────┼─────────────┼────────┼──────────────┤
│ 1500   │ 100         │ 0      │ 504          │
├────────┼─────────────┼────────┼──────────────┤
│ 1600   │ 100         │ 0      │ 505          │
├────────┼─────────────┼────────┼──────────────┤
│ 1700   │ 100         │ 0      │ 504          │
├────────┼─────────────┼────────┼──────────────┤
│ 1800   │ 100         │ 0      │ 507          │
├────────┼─────────────┼────────┼──────────────┤
│ 1900   │ 100         │ 0      │ 508          │
├────────┼─────────────┼────────┼──────────────┤
│ 2000   │ 100         │ 0      │ 507          │
└────────┴─────────────┴────────┴──────────────┘
#### total report ####
┌────────┬─────────────┬────────┬──────────────┬──────────────┬──────────────┐
│ Number │ Connections │ Errors │ Message Send │ Message Fail │ Duration(ms) │
├────────┼─────────────┼────────┼──────────────┼──────────────┼──────────────┤
│ 2000   │ 2000        │ 0      │ 0            │ 0            │ 19521        │
└────────┴─────────────┴────────┴──────────────┴──────────────┴──────────────┘
[[email protected] home]$ netstat -an | grep -e tcp -e udp | wc -l
2019
[[email protected] home]$ netstat -an | grep -e tcp -e udp | wc -l
2019
[[email protected] home]$ netstat -an | grep -e tcp -e udp | wc -l
2019
[[email protected] home]$ netstat -an | grep -e tcp -e udp | wc -l
2019
[[email protected] home]$ netstat -an | grep -e tcp -e udp | wc -l
2019
[[email protected] home]$ netstat -an | grep -e tcp -e udp | wc -l
2019
[[email protected] home]$ netstat -an | grep -e tcp -e udp | wc -l
2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant