there are physical limits. though nodes footprint is pretty low, at some
point cpu is pretty busy processing even simplest tasks, if they are many.
As Fedor said, concurrent connections and connection per second are two
different beasts. to handle 1m concurrent connections a traditional
synchronous server would create 1m threads (or worst, processes) with all
the stacks and memory needed. Node handles that in a sngle thread, but the
more connections there are, the bigger latency per request is need to
handle them. because it's single-threaded, you can however utilize the
cluster module to use more than one cpu core on your machine.
But to handle 1m connections per second, this is about latency, and this
you can only get for the price of higher resource usage. cluster mopdule,
hoizontal scaling over several physical machines. etc. node is not
different here form other tools. In fact typicaly it has same latency
pattern as rails or php-based solutions, if you use them the same way.
Nodes strenght is the ability to handle concurrent connections with much
lower footprint of memory.
Am Mittwoch, 19. Februar 2014 08:20:49 UTC+1 schrieb Nitin Gupta:
>
> My intent was same. I load test my app and increases the load
> successively.
> when it reaches to 10000 or above, a latency of more than 1sec is
> introduced (as CPU shoot up) which is not acceptable.
>
> so at this point my app is behaving like accepting 10000 req/s.
>
> On Tuesday, February 18, 2014 3:57:20 PM UTC+5:30, Nitin Gupta wrote:
>>
>> Hi, This is regarding scaling node.js application. I have heard a lot of
>> buzz around handling millions of connection by single node.js server.
>>
>> To check that i wrote a http server which was returning nothing but 200
>> ok and CPU started blowing up with 10000 concurrent requests.
>>
>> CODE:
>> my_http.createServer(function(request, response){
>> response.writeHead(200);
>> response.end();
>> });
>>
>> I have an application which has to handle 1M concurrent connections but
>> what i found with testing doesn't seem like a solution to this. Please
>> guide me through this. Have i missed something or is it not possible with
>> barebone node.js server.
>>
>> My application looks like:
>> a.) MongoDB with node.js
>> b.) A post request with some params.
>> c.) Saving params' values to DB and return to client with success or
>> failure
>>
>>
--
--
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.