I'm running a dotnetcore 3.1 application in a Docker container (in Kubernetes cluster).
First case :
I run the application with the following Docker/Kubernetes limits : requests.memory: 300Mi, limits.memory: 500Mi
. According to my monitoring, the application consumes 250Mi and it seems slow.
Second case :
I run the application with the following Docker/Kubernetes limits : requests.memory: 500Mi, limits.memory: 700Mi
. According to my monitoring, the application consumes 450Mi and it seems more fast.
In each case, the application is never OMMKilled, and seems limited by requests.memory
. I know Dotnetcore 3.1 uses cgroups, so I suppose it allows more or less memory usage in function of cgroups. But how it really works ? Why is it based on requests
and not on limits
? How do I know what requests/limits my application really needs ?