Question

The situation is that about 50.000 electronic devices are going to connect to a webservice created in node.js once per minute. Each one is going to send a POST request containg some JSON data. All this data should be secured. The web service is going to receive those requests, saving the data to a database. Also reading requests are possible to get some data from the DB.

I think to build up a system based on the following infrastructure:

Node.js + memcached + (mysql cluster OR Couchbase)

So, what memory requirements do I need to assign to my web server to be able to handle all this connections? Suppose that in the pessimistic possibility I would have 50.000 concurrent requests.

And what if I use SSL to secure the connections? Do I add too much overhead per connection? Should I scale the system to handle them?

What do you suggest me?

Many thanks in advance!

Was it helpful?

Solution

Of course, it is impossible to provide any valuable calculations, since it is always very specific. I would recommend you just to develop scalable and expandable system architecture from the very beginning.
And use JMeter https://jmeter.apache.org/ for load testing. Then you will be able to scale from 1000s to unlimited connections.
Here is a 1 000 000 connections article http://www.slideshare.net/sh1mmer/a-million-connections-and-beyond-nodejs-at-scale

OTHER TIPS

Remember that your nodejs application will be single threaded. Meaning your performance will degrade horribly when you increase the number of concurrent requests.

What you can do to increase your performance is create a node process for each core that you have on your machine all of them behind a proxy (say nginx), and you can also use multiple machines for your app.

If you make requests only to memcache then your api won't degrade. But once you start querying mysql it will start throttling your other requests.

Edit: As suggested in the comments you could also use clusters to fork worker processes and let them compete amongst each other for incoming requests. (Workers will run on a separate thread, thereby allowing you to use all cores). Node.js on multi-core machines

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top