Sunday, 5 August 2018

What metrics to use when scaling a Node.js application?

Suppose we have an orchestration system such as Kubernetes that allows to define resource allocation for every deployment (application). In case of Kubernetes, resource allocation is defined in terms of what a container requests (guaranteed to have) and the limits (the maximum that the container is allowed to claim) of the CPU and memory.Orchestration systems (such as Kubernetes) allow to scale the application (replicate) based on the CPU, memory and application-layer specific parameters, e.g.Increase the number of replications when container uses 90% of the allocated CPU; orIncrease the number of replications when the average number of active requests per deployment (application-layer metric) is >20.With the above functionality and information available, which are the metrics to use when scaling a [tag:node.js] application and what is the logic used to identify those metrics?Example:Given that in Node.js the main event loop is single-treaded, would it be correct to assert that as long as application does not use 100% of the allocated CPU (or memory) then scaling the application is unnecessary?I already know that the latter is not true. In that case, what are some valid strategies to measure and identify application-layer metrics used for scaling an application?

Submitted August 05, 2018 at 03:17PM by gajus0

No comments:

Post a Comment