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

Under stress, some connections keep open #15

Closed
revington opened this issue Jan 8, 2016 · 5 comments
Closed

Under stress, some connections keep open #15

revington opened this issue Jan 8, 2016 · 5 comments

Comments

@revington
Copy link

Under stress some connections will stay on CLOSE_WAIT state.

To reproduce the issue:

$ node close-wait.js close-wait.js below
$ wrk --latency -t4 -c400 -d30s "http://localhost:8000"

$ ss -e | grep 8000 | grep CLOSE
tcp    CLOSE-WAIT 0      0            127.0.0.1:8000          127.0.0.1:40084    uid:1000 ino:2562644 sk:ffff8803a9e2db00 -->

Everytime I run the stress test a new connection (the first one) remains in CLOSE_WAIT state

close-wait.js

'use strict';
var cluster = require('cluster');
var http = require('http');
var numCPUs = require('os').cpus().length;
var proxiedHttp = require('findhit-proxywrap').proxy(http, {
    strict: false
});
var i;

if (cluster.isMaster) {
    // Fork workers.
    for (i = 0; i < numCPUs; i++) {
        cluster.fork();
    }

} else {

    // Workers can share any TCP connection
    // In this case it is an HTTP server
    proxiedHttp.createServer(function handler(req, res) {
        return res.end('ok');
    }).listen(8000);
}
@cusspvz
Copy link
Member

cusspvz commented Jan 8, 2016

Interesting... Is this test code intermittent or actually works every time?

We aren't using this at the time on production, but yet I could check it by today. ;)

@revington
Copy link
Author

It works everytime for me

@revington
Copy link
Author

wrk, makes a connection before performing the test (the test use another connection/s).
The behavior of node to this connection is different when http has been proxied with proxywrap.

Without proxywrap, node will (record no. 10) answer FIN ACK to wrk
without-proxywrap

With proxywrap, node will just (record no. 10) answer only ACK to wrk
with-proxywrap

revington added a commit to revington/proxywrap that referenced this issue Jan 13, 2016

Unverified

The email in this signature doesn’t match the committer email.
@revington revington mentioned this issue Jan 13, 2016
cusspvz pushed a commit that referenced this issue Jan 14, 2016

Unverified

The email in this signature doesn’t match the committer email.
fix issue #15
@cusspvz cusspvz closed this as completed Jan 18, 2016
@cusspvz
Copy link
Member

cusspvz commented Jan 18, 2016

I've released 0.3.11, which includes your fix! Thanks once again.

@revington
Copy link
Author

You're welcome!

2016-01-18 15:54 GMT+01:00 José Moreira [email protected]:

I've released 0.3.11, which includes your fix! Thanks once again.


Reply to this email directly or view it on GitHub
#15 (comment).

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