...

/

Measuring the Actual Memory and CPU Consumption

Measuring the Actual Memory and CPU Consumption

In this lesson, we will figure out how to measure the actual memory and CPU consumption.

Exploring the Options

How did we come up with the current memory and CPU values? Why did we set the memory of the MongoDB to 100Mi? Why not 50Mi or 1Gi? It is embarrassing to admit that the values we have right now are random. We guessed that the containers based on the vfarcic/go-demo-2 image require less resources than Mongo database, so their values are comparatively smaller. That was the only criteria we used to define the resources.

Before you frown upon the decision to put random values for resources, you should know that we do not have any metrics to back us up. Anybody’s guess is as good as ours.

The only way to truly know how much memory and CPU an application uses is by retrieving metrics. We’ll use Heapster for that purpose.

Heapster collects and interprets various signals like compute resource usage, lifecycle events, etc. In our case, we’re interested only in CPU and memory consumption of the containers we’re running in our cluster.

When we created the cluster, we enabled the heapster addon and Minikube deployed it as a ...

Access this course and 1400+ top-rated courses and projects.