Improve redis configuration

* version bump to 3.9.7
* update changelog
This commit is contained in:
VirtuBox
2019-08-02 01:05:09 +02:00
parent 6a882d6a75
commit 1882b5c29e
5 changed files with 44 additions and 22 deletions

View File

@@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### v3.9.x - [Unreleased]
### v3.9.7 - 2019-08-02
#### Added
- MySQL configuration tuning
@@ -28,6 +30,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Removed WordOps version from the Nginx header X-Powered-By to avoid possible security issues
- Several code quality improvements to speed up WordOps execution
- Few adjustements on PHP-FPM configuration (max_input_time,opcache.consistency_checks)
-
#### Fixed
@@ -35,6 +38,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Fail2ban standalone install
- `wo stack purge --all` error due to PHP7.3 check
- Nginx helper configuration during plugin install for Nginx fastcgi_cache and redis-cache
- phpRedisAdmin stack installation
- Fixed Travis CI build on pull requests
### v3.9.6.2 - 2019-07-24

View File

@@ -7,10 +7,10 @@
# Copyright (c) 2019 - WordOps
# This script is licensed under M.I.T
# -------------------------------------------------------------------------
# Version 3.9.6.3 - 2019-07-29
# Version 3.9.7 - 2019-08-02
# -------------------------------------------------------------------------
readonly wo_version_old="2.2.3"
readonly wo_version_new="3.9.6.3"
readonly wo_version_new="3.9.7"
# CONTENTS
# ---
# 1. VARIABLES AND DECLARATIONS

View File

@@ -56,7 +56,7 @@ if not os.path.isfile('/root/.gitconfig'):
shutil.copy2(os.path.expanduser("~")+'/.gitconfig', '/root/.gitconfig')
setup(name='wo',
version='3.9.6.2',
version='3.9.7',
description=long_description,
long_description=long_description,
classifiers=[],

View File

@@ -10,6 +10,7 @@ import pwd
import random
import shutil
import string
import re
import psutil
# from pynginxconfig import NginxConfig
@@ -1590,7 +1591,8 @@ class WOStackController(CementBaseController):
# PHPREDISADMIN
if self.app.pargs.phpredisadmin:
if not os.path.isdir('/var/www/22222/htdocs/cache/redis/phpRedisAdmin'):
if not os.path.isdir('/var/www/22222/htdocs/'
'cache/redis/phpRedisAdmin'):
Log.debug(
self, "Setting packages variable for phpRedisAdmin")
self.app.pargs.composer = True
@@ -1728,38 +1730,53 @@ class WOStackController(CementBaseController):
WOShellExec.cmd_exec(self, "systemctl enable redis-server")
if os.path.isfile("/etc/redis/redis.conf"):
wo_ram = psutil.virtual_memory().total / (1024 * 1024)
if wo_ram < 512:
if wo_ram < 1024:
Log.debug(self, "Setting maxmemory variable to "
"{0} in redis.conf"
.format(int(wo_ram*1024*1024*0.1)))
WOShellExec.cmd_exec(self, "sed -i 's/# maxmemory"
" <bytes>/maxmemory {0}/'"
" /etc/redis/redis.conf"
.format(int(wo_ram*1024*1024*0.1)))
WOFileUtils.searchreplace(self,
"/etc/redis/redis.conf",
"# maxmemory <bytes>",
"maxmemory {0}"
.format
(int(wo_ram*1024*1024*0.1)))
Log.debug(
self, "Setting maxmemory-policy variable to "
"allkeys-lru in redis.conf")
WOShellExec.cmd_exec(self, "sed -i 's/# maxmemory-"
"policy.*/maxmemory-policy "
"allkeys-lru/' "
"/etc/redis/redis.conf")
WOFileUtils.searchreplace(self,
"/etc/redis/redis.conf",
"# maxmemory-policy "
"noeviction",
"maxmemory-policy "
"allkeys-lru")
Log.debug(
self, "Setting tcp-backlog variable to "
"in redis.conf")
WOFileUtils.searchreplace(self,
"/etc/redis/redis.conf",
"tcp-backlog 511",
"tcp-backlog 32768")
WOService.restart_service(self, 'redis-server')
else:
Log.debug(self, "Setting maxmemory variable to {0} "
"in redis.conf"
.format(int(wo_ram*1024*1024*0.2)))
WOShellExec.cmd_exec(self, "sed -i 's/# maxmemory "
"<bytes>/maxmemory {0}/' "
"/etc/redis/redis.conf"
.format(int(wo_ram*1024*1024*0.2)))
WOFileUtils.searchreplace(self,
"/etc/redis/redis.conf",
"# maxmemory <bytes>",
"maxmemory {0}"
.format
(int(wo_ram*1024*1024*0.1)))
Log.debug(
self, "Setting maxmemory-policy variable "
"to allkeys-lru in redis.conf")
WOShellExec.cmd_exec(self, "sed -i 's/# maxmemory-"
"policy.*/maxmemory-policy "
"allkeys-lru/' "
"/etc/redis/redis.conf")
WOFileUtils.searchreplace(self,
"/etc/redis/redis.conf",
"# maxmemory-policy "
"noeviction",
"maxmemory-policy "
"allkeys-lru")
WOService.restart_service(self, 'redis-server')
if 'mariadb-server' in apt_packages:
# setting innodb memory usage

View File

@@ -10,7 +10,7 @@ class WOVariables():
"""Intialization of core variables"""
# WordOps version
wo_version = "3.9.6.3"
wo_version = "3.9.7"
# WordOps packages versions
wo_wp_cli = "2.2.0"
wo_adminer = "4.7.2"