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

View File

@@ -7,10 +7,10 @@
# Copyright (c) 2019 - WordOps # Copyright (c) 2019 - WordOps
# This script is licensed under M.I.T # 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_old="2.2.3"
readonly wo_version_new="3.9.6.3" readonly wo_version_new="3.9.7"
# CONTENTS # CONTENTS
# --- # ---
# 1. VARIABLES AND DECLARATIONS # 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') shutil.copy2(os.path.expanduser("~")+'/.gitconfig', '/root/.gitconfig')
setup(name='wo', setup(name='wo',
version='3.9.6.2', version='3.9.7',
description=long_description, description=long_description,
long_description=long_description, long_description=long_description,
classifiers=[], classifiers=[],

View File

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

View File

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