Performance of .net GC in Kubernetes pod without memory limit Performance of .net GC in Kubernetes pod without memory limit kubernetes kubernetes

Performance of .net GC in Kubernetes pod without memory limit


Yes that's exactly what can happen, both with .NET and other pods.

Always set memory and CPU limits as this may have impact on other pods or Configure Default Memory Requests and Limits for a Namespace


@Martin is right but I would like to provide some more insight on this topic.

Kubernetes best practices: Resource requests and limits is a very good guide explaining the idea behind these mechanisms with a detailed explanation and examples.

Also, Managing Resources for Containers will provide you with the official docs regarding:

  • Requests and limits

  • Resource types

  • Resource requests and limits of Pod and Container

  • Resource units in Kubernetes

  • How Pods with resource requests are scheduled

  • How Pods with resource limits are run, etc

Bear in mind that it is very important is to have a good strategy when calculating how much resources you would need for each container.Optimally, your pods should be using exactly the amount of resources you requested but that's almost impossible to achieve. If the usage is lower than your request, you are wasting resources. If it's higher, you are risking performance issues. Consider a 25% margin up and down the request value as a good starting point. Regarding limits, achieving a good setting would depend on trying and adjusting. There is no optimal value that would fit everyone as it depends on many factors related to the application itself, the demand model, the tolerance to errors etc.

And finally, you can use the metrics-server to get the CPU and memory usage of the pods.