Running multiple instances of Parse Server on the same machine

When migrating from to Parse Server, I learned the hard way that NodeJS is not multi-threaded.

ParseServer is made in JavaScript with NodeJS and unfortunately, this technology doesn’t take advantage of the multiple cores your server can have.

This lead to a waste of resources: imagine that a running instance of your server is only using 25/30% CPU before latency goes up. At that point, you have to deploy a new instance of the same server to maintain a low latency. Why? Because of the use of a single thread, incoming requests are quickly queued, especially if one the request takes time to build the response.

To take advantage of the multiples cores you may have on your server, you can use a worker manager such as Throng to manage multiple instances of your Parse Server on the same machine:

Don’t ask for too many workers. The appropriate number of workers depends of the number of cores your machine has and is usually a number between 1 and (2 x NUMBER_OF_CORES) + 1.

Next up

Leave a Reply

Your email address will not be published. Required fields are marked *