Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2018-10-01 01:52:16 +0300
committernachoparker <nacho@ownyourbits.com>2018-10-01 01:52:16 +0300
commit4f20b716f8fc6ace3d5e3414931e35889e1fab7f (patch)
treeea3f4eb70eeda791b2da6d0d55825e96c61dc638
parent6b14527ab4572008bbf3a243c5d1494ad18c7c54 (diff)
redis: change eviction policyv0.62.1
-rw-r--r--etc/ncp-config.d/nc-limits.sh14
-rw-r--r--etc/ncp-config.d/nc-nextcloud.sh1
-rwxr-xr-xupdate.sh8
3 files changed, 16 insertions, 7 deletions
diff --git a/etc/ncp-config.d/nc-limits.sh b/etc/ncp-config.d/nc-limits.sh
index 1687d692..fc61e085 100644
--- a/etc/ncp-config.d/nc-limits.sh
+++ b/etc/ncp-config.d/nc-limits.sh
@@ -32,17 +32,17 @@ configure()
local CONF=/var/www/nextcloud/.user.ini
local CURRENT_PHP_MEM="$( grep "^memory_limit" "$CONF" | sed 's|.*=||' )"
[[ "$MEMORYLIMIT_" == "0" ]] && MEMORYLIMIT_=$AUTOMEM && echo "Using ${AUTOMEM}B for PHP"
- sed -i "s/post_max_size=.*/post_max_size=$MAXFILESIZE_/" "$CONF"
- sed -i "s/upload_max_filesize=.*/upload_max_filesize=$MAXFILESIZE_/" "$CONF"
- sed -i "s/memory_limit=.*/memory_limit=$MEMORYLIMIT_/" "$CONF"
+ sed -i "s/^post_max_size=.*/post_max_size=$MAXFILESIZE_/" "$CONF"
+ sed -i "s/^upload_max_filesize=.*/upload_max_filesize=$MAXFILESIZE_/" "$CONF"
+ sed -i "s/^memory_limit=.*/memory_limit=$MEMORYLIMIT_/" "$CONF"
# MAX PHP THREADS
local CONF=/etc/php/${PHPVER}/fpm/pool.d/www.conf
local CURRENT_THREADS=$( grep "^pm.max_children" "$CONF" | awk '{ print $3 }' )
[[ "$PHPTHREADS_" == "0" ]] && PHPTHREADS_=$( nproc ) && echo "Using $PHPTHREADS_ PHP threads"
- sed -i "s|pm.max_children =.*|pm.max_children = $PHPTHREADS_|" "$CONF"
- sed -i "s|pm.max_spare_servers =.*|pm.max_spare_servers = $PHPTHREADS_|" "$CONF"
- sed -i "s|pm.start_servers =.*|pm.start_servers = $PHPTHREADS_|" "$CONF"
+ sed -i "s|^pm.max_children =.*|pm.max_children = $PHPTHREADS_|" "$CONF"
+ sed -i "s|^pm.max_spare_servers =.*|pm.max_spare_servers = $PHPTHREADS_|" "$CONF"
+ sed -i "s|^pm.start_servers =.*|pm.start_servers = $PHPTHREADS_|" "$CONF"
# RESTART PHP
[[ "$PHPTHREADS_" != "$CURRENT_THREADS" ]] || \
@@ -62,7 +62,7 @@ configure()
local CURRENT_REDIS_MEM=$( grep "^maxmemory" "$CONF" | awk '{ print $2 }' )
[[ "$REDISMEM_" == "0" ]] && REDISMEM_=$AUTOMEM && echo "Using ${AUTOMEM}B for Redis"
[[ "$REDISMEM_" != "$CURRENT_REDIS_MEM" ]] && {
- sed -i "s|maxmemory .*|maxmemory $REDISMEM_|" "$CONF"
+ sed -i "s|^maxmemory .*|maxmemory $REDISMEM_|" "$CONF"
service redis-server restart
}
}
diff --git a/etc/ncp-config.d/nc-nextcloud.sh b/etc/ncp-config.d/nc-nextcloud.sh
index 0ce3b075..848d0ca5 100644
--- a/etc/ncp-config.d/nc-nextcloud.sh
+++ b/etc/ncp-config.d/nc-nextcloud.sh
@@ -64,6 +64,7 @@ install()
sed -i "s|# unixsocket .*|unixsocket /var/run/redis/redis.sock|" $REDIS_CONF
sed -i "s|# unixsocketperm .*|unixsocketperm 770|" $REDIS_CONF
sed -i "s|# requirepass .*|requirepass $REDISPASS|" $REDIS_CONF
+ sed -i 's|# maxmemory-policy .*|maxmemory-policy allkeys-lru|' $REDIS_CONF
sed -i 's|# rename-command CONFIG ""|rename-command CONFIG ""|' $REDIS_CONF
sed -i "s|^port.*|port 0|" $REDIS_CONF
echo "maxmemory $REDIS_MEM" >> $REDIS_CONF
diff --git a/update.sh b/update.sh
index 06164041..e417661c 100755
--- a/update.sh
+++ b/update.sh
@@ -257,6 +257,14 @@ EOF
service php${PHPVER}-fpm start
service mysql start
" &>/dev/null &
+
+ # PHP7.2 end
+
+ # Redis eviction policy
+ grep -q "^maxmemory-policy allkeys-lru" /etc/redis/redis.conf || {
+ sed -i 's|# maxmemory-policy .*|maxmemory-policy allkeys-lru|' /etc/redis/redis.conf
+ service redis-server restart
+ }
}
} # end - only live updates