automemlimit icon indicating copy to clipboard operation
automemlimit copied to clipboard

Support gomemlimit from requests

Open bohdand-weka opened this issue 1 year ago • 4 comments

As limits is some memory for burst cases, I think the better way to set gomemlimit is to set it within requests.

Is there a way to do this?

bohdand-weka avatar Jul 29 '24 07:07 bohdand-weka

Did you mean limiting memory within a request like an HTTP request? It's not possible in Go. The Go memory limit system only sets the soft limit for the entire Go runtime.

KimMachineGun avatar Jul 30 '24 02:07 KimMachineGun

@bohdand-weka Please let me know if I understand your question correctly. If you think I did, I'll close this issue.

KimMachineGun avatar Aug 02 '24 07:08 KimMachineGun

Hi @KimMachineGun , thank you for reply.

The question is that pods are having memory request and memory limit, so can we choose which value to use, sometimes using requests is more accurate and prevents OOM, but some people likes to use limit.

bohdand-weka avatar Aug 02 '24 08:08 bohdand-weka

@bohdand-weka Thank you for letting me know. I completely misunderstood 😅.

There is no way to retrieve memory requests from the system for now. So, the best way to use GOMEMLIMIT with memory requests is using Kubernetes Downward API.

This post might be helpful for you.

KimMachineGun avatar Aug 02 '24 09:08 KimMachineGun