Sunday, January 15, 2017

How to calculate number of database pools for Nodejs Application

Few things to take for consideration before deciding on the numbers, those are CPU, Database size, number of concurrent requests. Say we have configured our application to serve 100 concurrent requests coming per second, in which 0.25% are spent on database querying which is 15 seconds are spent on database. In this case the we need to set the number of db connections to 25. which would be the optimum in most cases. But it also depends on the query size, network .

For a Nodejs Application, say we are using four cpu's and we have used cluster to spawn child process. Each process will run a node thread.

Less is good. Keep the connections minimum to better performance

(core_count * 2) + spindle_count
spindle_count is disk spindle time to fetch the data. 

Wednesday, March 2, 2011

Rails Cucumber

Cucumber to run a Single feature
rake FEATURE=features/create_product.feature cucumber