So I just noticed that the HTTP server in node v0.2.0 doesn't seem to be able to handle multiple concurrent requests. Demo code is at http://gist.github.com/550726Am I doing something wrong here?
--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.
http.Client is a single TCP stream, not a pool of HTTP connections.
HTTP does not support concurrent requests, only pipelining - which
Node's client avoids because it's not well supported by servers.
(Node's HTTP server does support clients who send pipelined requests.)
So I just noticed that the HTTP server in node v0.2.0 doesn't seem to be able to handle multiple concurrent requests. Demo code is at http://gist.github.com/550726
var http = require('http')
http.createServer(function (request, response) {
console.log(request.url+" Request received")
setTimeout(function() {
console.log(request.url+" Response sent")
response.writeHead(200, {'Content-Type': 'text/plain'})
response.end('Hello World\n')
}, 1000)
}).listen(8124)
for (var i = 0; i < 10; i++) {
var client = http.createClient(8124);
var request = client.request('GET', '/'+i, {'host': 'localhost'})
request.end()
console.log("/"+i+" Request sent")
}
--i
Pretty sure you're imagining things. At least as long as I've been
messing with it, this is how node's http client has worked.
A single *server* can handle lots of requests at once. But a single
*client* can only process one request at a time. Additional requests
stack up and wait their turn.
--i
Though for my couchdb driver, is it possible to do pipelining (in the client) or is that support not there?
I'm fine with a connection pool if it's not there.
--
--
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 nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
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 nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/z0xMSW5riDI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.