feat(redis): add memory calcualtion when not running on fly
This commit is contained in:
@@ -10,14 +10,13 @@ if [[ ! -z "${REDIS_PASSWORD}" ]]; then
|
|||||||
PW_ARG="--requirepass $REDIS_PASSWORD"
|
PW_ARG="--requirepass $REDIS_PASSWORD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set maxmemory-policy to 'allkeys-lru' for caching servers that should always evict old keys
|
: ${MAXMEMORY_POLICY:="noeviction"}
|
||||||
: ${MAXMEMORY_POLICY:="volatile-lru"}
|
|
||||||
: ${APPENDONLY:="no"}
|
: ${APPENDONLY:="no"}
|
||||||
: ${FLY_VM_MEMORY_MB:=512}
|
: ${FLY_VM_MEMORY_MB:=$(($(grep MemTotal /proc/meminfo | awk '{print $2}') / 1024))}
|
||||||
if [ "${NOSAVE}" = "" ] ; then
|
if [ "${NOSAVE}" = "" ] ; then
|
||||||
: ${SAVE:="3600 1 300 100 60 10000"}
|
: ${SAVE:="3600 1 300 100 60 10000"}
|
||||||
fi
|
fi
|
||||||
# Set maxmemory to 10% of available memory
|
# Set maxmemory to 80% of RAM
|
||||||
MAXMEMORY=$(($FLY_VM_MEMORY_MB*80/100))
|
MAXMEMORY=$(($FLY_VM_MEMORY_MB*80/100))
|
||||||
|
|
||||||
mkdir /data/redis
|
mkdir /data/redis
|
||||||
|
|||||||
Reference in New Issue
Block a user