Application-server container memory limits#452
Conversation
51cfacd to
30fb04f
Compare
30fb04f to
6689d87
Compare
93e9f38 to
af35ce1
Compare
| echo "First run, initializing container state" | ||
| rebuild=true | ||
| # Allow override via metadata | ||
| MEMORY_LIMIT_OVERRIDE="$(get_metadata_value "memory-limit" "")" |
There was a problem hiding this comment.
do we not want to let the user configure the memory limit? since I believe they can set guest attributes but not always metadata, and we're not triggering a recreate if it changes. that's fine if so, but just wanted to confirm
There was a problem hiding this comment.
Good callout, our naming isn't accurate, set_metadata sets the guest attributes and get_metadata gets the metadata.
Yes we should be using guest attributes, I'm leaning towards removing the MEMORY_LIMIT_OVERRIDE as we do require allocating a certain percentage of memory for system processes and other containers. Thoughts?
There was a problem hiding this comment.
Yeah I think this is something we can just set ourselves and not let users change
| local total_mem_mb=$((total_mem_bytes / 1024 / 1024)) | ||
|
|
||
| # Reserve memory for host OS, proxy-agent, fluent-bit, and other system processes | ||
| # Reserve whichever is larger: 1GB or 10% of total memory |
There was a problem hiding this comment.
I wonder if we could just always reserve 1GB, I don't think the host should be using more than that
To prevent the application-server container from using all of the machine's memory, set a memory limit on the container.