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

Timeout issue #13

Open
cthackers opened this issue Jan 29, 2015 · 8 comments
Open

Timeout issue #13

cthackers opened this issue Jan 29, 2015 · 8 comments

Comments

@cthackers
Copy link

Hi,
I have some issues with this library and the number of connections it creates. I don't know exactly if the library is the problem or my configs but I was doing a simple test with

{
    maxSockets: 5,
    maxFreeSockets: 5, 
    keepAliveMsecs: 100
    .....
} 

then do 100 requests with some small random time intervals between them. The result i get is something like this and doesn't seem to add up

{
    .....
    keepAliveMsecs: 100,
    keepAlive: true,
    maxSockets: 5,
    maxFreeSockets: 5,
    maxKeepAliveRequests: 0,
    createSocketCount: 18,
    timeoutSocketCount: 4,
    requestFinishedCount: 100 
}

If only 4 sockets timed out why did it create 18 ? Shouldn't have been 9 there ? The initial 5 sockets and the additional 4 that were replaced because they timed out. Btw, the numbers vary on every run. What am I missing here ?

@fengmk2
Copy link
Member

fengmk2 commented Jan 29, 2015

keepAliveMsecs:100 meaning a free socket not active for 100ms it will close.

@cthackers
Copy link
Author

Yes, unless there is activity on it so it doesn't time out. So only 4 sockets timed out, and if they needed to be recreated, a maxim of 9 sockets should have been created in total, or anywhere between 5 and 9 if some of those 4 timed out sockets expired and the end of the test and had nothing left in queue. So why 18 ?

@fengmk2
Copy link
Member

fengmk2 commented Jan 30, 2015

can you show me the closeSocketCount and requestCount values?

@cthackers
Copy link
Author

I don't have such values in the result. I use version 0.2.3.

@cthackers
Copy link
Author

also i get an error like this
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
the stack trace indicates _http_agent.js:214:10 and agent.js:107:20

@cthackers
Copy link
Author

and for HTTPS connections, it uses the certificate files as keys in the getName function. The application i use this in, has one 50KB certificate file with all the certificates. The log increased to 1.5 GB in less than a minute. Why in the world you would use the content of the certificates and keys as the key to the map ?

@fengmk2
Copy link
Member

fengmk2 commented Feb 6, 2015

can you show me your demo codes, node version and agentkeepalive version, I want to repeat what your meaning.

@DesignByOnyx
Copy link

I too would like to run this library through some perf tests. I know this thread is a little stale, but @fengmk2 can you post the scripts, versions, etc you used for testing?

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

3 participants