rename "dragonfly" to "redis"

This commit is contained in:
Gergő Móricz
2024-08-23 17:05:59 +02:00
parent 64e9be0cd4
commit 52a05b8c6e
9 changed files with 0 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash
set -e
sysctl vm.overcommit_memory=1 || true
sysctl net.core.somaxconn=1024 || true
PW_ARG=""
if [[ ! -z "${REDIS_PASSWORD}" ]]; then
PW_ARG="--requirepass $REDIS_PASSWORD"
fi
# Set maxmemory-policy to 'allkeys-lru' for caching servers that should always evict old keys
: ${MAXMEMORY_POLICY:="volatile-lru"}
: ${APPENDONLY:="no"}
: ${FLY_VM_MEMORY_MB:=512}
if [ "${NOSAVE}" = "" ] ; then
: ${SAVE:="3600 1 300 100 60 10000"}
fi
# Set maxmemory to 10% of available memory
MAXMEMORY=$(($FLY_VM_MEMORY_MB*80/100))
mkdir /data/redis
redis-server $PW_ARG \
--dir /data/redis \
--maxmemory "${MAXMEMORY}mb" \
--maxmemory-policy $MAXMEMORY_POLICY \
--appendonly $APPENDONLY \
--save "$SAVE"