Commit b9827816 authored by Troels Thomsen's avatar Troels Thomsen Committed by Jeremy Morrell

Read memory limit

parent b119743b
...@@ -15,15 +15,12 @@ log_concurrency() { ...@@ -15,15 +15,12 @@ log_concurrency() {
detect_memory() { detect_memory() {
local default=$1 local default=$1
local limit=$(ulimit -u)
case $limit in if [ -e /sys/fs/cgroup/memory/memory.limit_in_bytes ]; then
256) echo "512";; # Standard-1X expr "$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)" / 1048576
512) echo "1024";; # Standard-2X else
16384) echo "2560";; # Performance-M echo "$default"
32768) echo "14336";; # Performance-L fi
*) echo "$default";;
esac
} }
export MEMORY_AVAILABLE=${MEMORY_AVAILABLE-$(detect_memory 512)} export MEMORY_AVAILABLE=${MEMORY_AVAILABLE-$(detect_memory 512)}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment