mendix / docker-mendix-buildpack

Build and Run Mendix in Docker
https://www.mendix.com
Apache License 2.0
87 stars 113 forks source link

Sane default for memory limit #175

Open basi01 opened 1 year ago

basi01 commented 1 year ago

Currently, the script copies the static file "vcap_application.json" to the container and inside we have "mem": 1024. Please modify the function create_vcap_application() to load memory information from /sys/fs/cgroup/memory/memory.stat and calculate a sane default for the memory limit. For example: min(hierarchical_memsw_limit, hierarchical_memory_limit*2 ). See https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt

It will still be possible to override this calculation with the env var MEMORY_LIMIT.

Our case is Kubevela and we control the resources limits with the vela manifest:

      resources: 
        cpu: 4
        memory: 8Gi

We don't want to duplicate this info into the environment variables.