-
Notifications
You must be signed in to change notification settings - Fork 4
Solve/avoid OOM kills and memory fatals by doing our own checks #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
will use in grol-io/grol-discord-bot#80 to avoid bot crashes |
…al/crashes, limit length of values in state file (#80) * Harden the service Per discord gophers reco * Note about using LoadCredential= and limit memory usage to avoid fatal errors * Prep for using grol-io/grol#159 (will edit this PR when released) * released version of grol
|
Hey, I have put this PR in a place of honor in a number of my "tips and tricks" guides. People are usually quite impressed! I know this is old, and you are likely already aware, but I usually mention this PR in the same breath as pointing out the pitfalls of running inside a container where Go can sometimes accidentally confuse the container's resource limits with the host's resource limits. There are some band-aid library workarounds: https://github.com/KimMachineGun/automemlimit |
|
@StevenACoffman glad you find it useful (where is that tips and tricks guide btw?) Personally I think CPU limits are bad which is also why I think automaxprocs is also bad: they waste precious sys cpu for unecessary enforcement, as cpu is elastic (unlike memory) golang/go#73193 (comment) But this is about memory, which is definitively not elastic |
|
golang/go#68934 is the (sadly closed) go issue, maybe new leadership will reconsider |
so
also to limit IOs:
this originates from stepping on https://github.com/ldemailly/go-scratch/blob/main/membug/membug.go ie you can allocate 10x the limit and get no error, until you get OOM killed or fatal, but no recoverable error, this makes it recoverable