Home > database >  Estimate Kubernetes resources for microservices
Estimate Kubernetes resources for microservices

Time:07-07

I want to run a test sever based on Kubernetes with around 60 Spring Boot microservices.

How I can estimate how much CPU, RAM and resources I will need.

CodePudding user response:

You can start by first running your application under a realistic load for it and use any instrumentation tools to measure how much CPU/memory an instance of your micro-service consumes. Note this value for CPU and memory.

A simple calculation might suggest total = 60* size_of_instance but you have to be mindful of the overhead in your infrastructure as well.

If your k8s environment has certain 'infrastructure components' running on your worker nodes, you need to be able to add those in your equation as well. So, the final requirement of your node will be (assuming you want to run them all on a single node): Total = 60 * size_of_instance infra_overhead_on_node

CodePudding user response:

There is no exact estimate. You can spin up all your instances, assuming they all 60 run different code, stress-test them, and monitor the CPU Mem, then double that just so they have room to breathe.. which might also prove to not be enough, depending on your code for each pod..

So, test, adjust, test again, adjust again (with some buffer in mind, so pods do not die due to resource exhaustion), repeat, repeat again, and again :)

If you can, optimize the pods so they use less resources, better code, etc...

  • Related