I am facing an issue when trying to keep more than 32768 concurrent HTTP
connections in a nodejs server running on a SmartOS machine. Once I reach
that number of concurrent connections, the server starts rejecting new HTTP
requests.
I have already increased the max number of file descriptors to 999999 with
ulimit:
[root ~]# ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
*open files (-n) 999999
*pipe size (512 bytes, -p) 10
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 99994
virtual memory (kbytes, -v) unlimited
This is my nodejs code:
var http = require("http");
var PORT = 4000;
var KEEPALIVE_SECS = 30;
http.createServer(function(request, response) {
response.writeHead(200, 'Ok');
setInterval(function() {
response.write('keepalive');
}, KEEPALIVE_SECS * 1000);
}).listen(PORT);
If I run two processes (listening on different ports) I can handle 32K x 2
= 64K concurrent connections, so I think the limitation has something to do
with the max number of file descriptors per process. Is there any
limitation in nodejs I should be aware of?
I am using node 0.10.4. The virtual machine I am using is hosted at Joyent,
and is plenty of resources (16GB RAM and 12 VCPUs).
Thank you in advance,
Guido.
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.