Three areas to take care in scaling Multiple instances Microservices Database Partitioning How to fork? const { fork } = require('child-process); const processes = [ fork('./app', ['3001']), fork('./app' , ['3002'] ), fork('./app' , ['3003'] ) ] Check CPUs on machine const cpus = require('os').cpus; console.log(cpus); Run as many instances of node app as many CPUs are available. Write the following to index.js and run in Node const http = require ( 'http' ); const cluster = require ( 'cluster' ); const cpus_len = require ( 'os' ). cpus (). length ; if ( cluster . isMaster ) { console . log ( "FORKING" , process . pid ); for ( let i = 0 ; i < cpus_len ; i ++) { cluster . fork (); ...
Project Weekay | Resume | LinkedIn Profile
NodeJS, AWS, MongoDB, ReactJS, Django, Python, ML with Scikit Learn, Matplotlib, Seaborn
Engineering, UX, Marketing, Product Designing, Business
sayhellotovinit@gmail.com | +91 99239 08880 | Pune, India