Want to subscribe to topics you're interested in?
Become a Member

Redis and wordpress

Discussion in 'Blogs & CMS usage' started by ahmed, Mar 26, 2017.

  1. ahmed

    ahmed Member

    201
    15
    18
    Feb 21, 2017
    Ratings:
    +21
    Local Time:
    3:24 PM
    Hello

    I have this warning:

    Code:
    15634:M 26 Mar 00:16:46.679 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
    

    I have Nginx 1.11.12 with brotli
    Php 7.1.3
    openssl "getting ready for TLS 1.3 :)"

    -did i do something wrong? or this need to be set by default inside centminmod?
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,149
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    11:24 PM
    Nginx 1.13.x
    MariaDB 5.5
    You can only disable Transparent Huge Pages on non-OpenVZ systems. Where are you seeing this error message ?

    On Centmin Mod 123.09beta01 php upgrades will usually detect if redis server is installed and auto disable Transparent Huge Pages if you are on non-OpenVZ systems, i.e. dedicated, kvm, xen, vmware.

    On Centmin Mod 123.09beta01, you can also run /usr/local/src/centminmod/tools/hptweaks.sh script https://community.centminmod.com/threads/transparent-huge-pages-tweaks-tools-hptweaks-sh.5340/ to take care of it if on non-OpenVZ systems.
     
  3. ahmed

    ahmed Member

    201
    15
    18
    Feb 21, 2017
    Ratings:
    +21
    Local Time:
    3:24 PM
    ok, that makes since

    the script comes when I run
    tail -50 /var/log/redis/redis.log

    ---
    I upgraded php, and then installed wordpress for a domian (without redis
    then installed another domain with redis)

    ---
    I will re-compile php
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,149
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    11:24 PM
    Nginx 1.13.x
    MariaDB 5.5
    to save time just run /usr/local/src/centminmod/tools/hptweaks.sh unless upgrading php for new version too
     
  5. ahmed

    ahmed Member

    201
    15
    18
    Feb 21, 2017
    Ratings:
    +21
    Local Time:
    3:24 PM
    recompiled, rebooted the VPS, still the warning msg

    the command u advised shows:

    Code:
    [12:33][root@wordpress1 Ahmed]# sh /usr/local/src/centminmod/tools/hptweaks.sh
    
    
    transparent huge pages not supported
    
    no tweaks needed
    
     
  6. ahmed

    ahmed Member

    201
    15
    18
    Feb 21, 2017
    Ratings:
    +21
    Local Time:
    3:24 PM
    I added
    echo never > /sys/kernel/mm/transparent_hugepage/enabled
    to
    /etc/rc.local
     
  7. eva2000

    eva2000 Administrator Staff Member

    30,149
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    11:24 PM
    Nginx 1.13.x
    MariaDB 5.5
    did you restart redis server after the change ?

    hptweaks.sh look for the setting in /sys/kernel/mm/redhat_transparent_hugepage/enabled
    Code (Text):
    cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
    always madvise [never]

    which seems to be same as at /sys/kernel/mm/transparent_hugepage/enabled
    Code (Text):
    cat /sys/kernel/mm/transparent_hugepage/enabled
    always madvise [never]
    

    but if it doesn't exist at /sys/kernel/mm/redhat_transparent_hugepage/enabled that system returns transparent huge pages not supported

    also are you on openvz vps ? if so you can't change such settings and have to live with lower performance of redis on openvz vps with transparent huge pages enabled
     
  8. eva2000

    eva2000 Administrator Staff Member

    30,149
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    11:24 PM
    Nginx 1.13.x
    MariaDB 5.5
    seems CentOS 7 doesn't have /sys/kernel/mm/redhat_transparent_hugepage/enabled only
    /sys/kernel/mm/transparent_hugepage/enabled !

    edit: just updated 123.09beta01 with fix for that so another bug squashed :)
     
    • Like Like x 1
  9. ahmed

    ahmed Member

    201
    15
    18
    Feb 21, 2017
    Ratings:
    +21
    Local Time:
    3:24 PM
    Although I can barely understand what u are syaing but looks like I discovered somthing new :)

    the
    Code:
    I added 
    echo never > /sys/kernel/mm/transparent_hugepage/enabled
    to 
    /etc/rc.local
    
    fixed the redis warning, am I good now?
    I noticed that the backend of wordpress is slower, but it is not related to the redis plugin, but the plugin object cache didnt improve it
     
  10. eva2000

    eva2000 Administrator Staff Member

    30,149
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    11:24 PM
    Nginx 1.13.x
    MariaDB 5.5
    yeah my fix for hptweaks.sh is same result of what you did manually to disable transparent huge pages so you should be good after redis restart on non-openvz systems
     
  11. ahmed

    ahmed Member

    201
    15
    18
    Feb 21, 2017
    Ratings:
    +21
    Local Time:
    3:24 PM
    luckily google cloud are on KVM :)
     
    • Like Like x 1
  12. ahmed

    ahmed Member

    201
    15
    18
    Feb 21, 2017
    Ratings:
    +21
    Local Time:
    3:24 PM
  13. eva2000

    eva2000 Administrator Staff Member

    30,149
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    11:24 PM
    Nginx 1.13.x
    MariaDB 5.5
    123.09beta01 centmin.sh menu option 22 no longer auto installs redis object wp plugin due to too long caching of changed wp admin settings. Did you install the plugin yourself ?

    is redis server running ?
     
  14. ahmed

    ahmed Member

    201
    15
    18
    Feb 21, 2017
    Ratings:
    +21
    Local Time:
    3:24 PM
    Yes I installed the "REDIS object cach myself"

    and added this to the wp-config

    Code:
    define('WP_CACHE_KEY_SALT', md5( DB_NAME . $table_prefix . FILE ) );
    define('WP_REDIS_MAXTTL', 28800);
    define('WP_REDIS_DATABASE', 7);
    
     
  15. eva2000

    eva2000 Administrator Staff Member

    30,149
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    11:24 PM
    Nginx 1.13.x
    MariaDB 5.5
    Just remove redis object cache plugin, not needed really it causes issues when you change admin settings it caches too long until you do a php restart. Haven't seen it slow down wp admin backend though.
     
    • Like Like x 1
  16. ahmed

    ahmed Member

    201
    15
    18
    Feb 21, 2017
    Ratings:
    +21
    Local Time:
    3:24 PM
    so no advantage of object caching at all on wordpress from your experience?
     
  17. eva2000

    eva2000 Administrator Staff Member

    30,149
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    11:24 PM
    Nginx 1.13.x
    MariaDB 5.5
    there is for large traffic sites but - you'd end up having to restart php after each wp admin backend settings change you make or after saving a settings change.