Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command-line hanging / not exiting on completion #229

Open
hoeken opened this issue Nov 28, 2023 · 3 comments
Open

Command-line hanging / not exiting on completion #229

hoeken opened this issue Nov 28, 2023 · 3 comments

Comments

@hoeken
Copy link

hoeken commented Nov 28, 2023

I'm using loadtest to test the performance of my websocket server on an embedded device (which is why the #s are so low)

I have a script that tests at different levels of concurrent users, from 1 to 20. Everything works great from 1 to 7, but as soon as I test with a concurrency of 8 the program doesn't exit. It seems this is true for any concurrency # above 7. I am setting --cores to 1 since I want to control exactly how many connections I have to the device.

If I remove the --cores 1 option, then it works fine, although then I have to do some math to get the exact # of connections.

The weird thing is that the script completes and prints statistics, but then it simply doesn't exit as if its waiting for something else to complete.

Also, every time it starts up, it lists a bunch of potential memory leak errors which you can see below:

loadtest -c 8 --cores 1 -t 10 ws://192.168.2.131/ws
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
(node:34199) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [WebSocketConnection]. Use emitter.setMaxListeners() to increase limit
Requests: 521, requests per second: 104, mean latency: 64.8 ms

Target URL:          ws://192.168.2.131/ws
Max time (s):        10
Concurrent clients:  8
Agent:               none

Completed requests:  1066
Total errors:        0
Total time:          10.006 s
Mean latency:        64.2 ms
Effective rps:       107

Percentage of requests served within a certain time
  50%      57 ms
  90%      103 ms
  95%      114 ms
  99%      132 ms
 100%      146 ms (longest request)

I am running on Mac with this software installed:

% npm -v             
10.2.0
% node -v            
v21.1.0
% loadtest --version 
Loadtest version: 8.0.5
@alexfernandez
Copy link
Owner

Sorry for the delay. I have seen this behavior also for non-websocket tests, not sure what is causing the memory leak?

@alexfernandez
Copy link
Owner

Hi again! After some investigation, there is a definite memory leak for websockets. Support was added by another developer but the package has evolved a lot and I'm afraid it is not up to par at the moment. I don't have the knowledge or the time to fix it; if you want to work on it you are most definitely welcome!

@hoeken
Copy link
Author

hoeken commented Dec 11, 2023

I might give it a look at some point. Its definitely meeting my needs for now right now though with wss support working.

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

No branches or pull requests

2 participants