Created
March 24, 2016 16:59
-
-
Save dpeterka/8cc3e88f2fca2f882d0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Percent of total sytem memory to use | |
xmx_percent=.7 # Memory to use for supervisord and the OS | |
worker_mem=1000 # Memory per worker | |
# Total system memory available | |
system_memory_in_mb=$(free -m | awk '/Mem:/ {print $2}') | |
xmx_memory_float=$(echo "$system_memory_in_mb*$xmx_percent"|bc) | |
xmx_memory=$(echo "($xmx_memory_float+0.5)/1" | bc) | |
num_workers_float=$(echo "$xmx_memory/$worker_mem"|bc) | |
num_workers=$(echo "($num_workers_float+0.5)/1" | bc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment