• Home
  • WordPress
  • web Hosting
  • linux
  • mysql
  • nginx
  • apache2
  • devops

Raju Ginni

wordpress tutorials seo hosting etc

You are here: Home / tutorials / redis install ubuntu 20.04 with wordpress php redis mysql configuration / redis wordpress (install, configure, tweak performance ) compared with memcached

redis wordpress (install, configure, tweak performance ) compared with memcached

 

Table of Contents

Toggle
  • Redis installation on wordpress ubuntu & debian
    • Redis configuration for wordpress
  • wordpress & redis install PHP client phpredis
  •   wp – config php on each wordpress install
  • Install Redis Object Cache – WordPress plugin
  • Redis object cache with W3tc (wp rocket won’t support now)
  • Redis vs memcached which is best for wordpress
  • Cloudways redis wordpress managed no more dig
  • Monitoring redis wordpress with commands slow query
  • Performance tips

Redis installation on wordpress ubuntu & debian

 

sudo apt-get update && apt install redis-server

 

Redis configuration for wordpress

 

nano /etc/redis/redis.conf

 

Default binding port 6379 and 127.0.0.1

memory no limit

maxmemory limit

Cache eviction policy LRU

disable RDB persistent *

enabled thread IO (if persistent to disk enabled)

Max clients default = 10000

wordpress & redis install PHP client phpredis

sudo apt install php-redis

or incase php-fpm

sudo apt install php7.4-redis

its automatically added enabled as a extension.

you may edit php extension later.

  wp – config php on each wordpress install

wp – object cache enable true

define(‘WP_CACHE’, true);

define(‘WP_CACHE_KEY_SALT’, ‘yoursite.com’);

in order to wordpress works with object cache you should add above lines in wp config php.

cache key salt used identify queries on redis cli monitor or anywhere later for debugging process.

 

you can check quickly in terminal

cat /var/www/html/rajuginni.com/wp-config.php   our using grep command

root@-s-4vcpu-8gb-blr1-01:~# grep WP_CACHE_KEY_SALT /var/www/html/rajuginni.com/wp-config.php
//define(▒WP_CACHE_KEY_SALT▒, ▒raaz.com▒);

its commented

Install Redis Object Cache – WordPress plugin

Redis Object Cache By Till Krüss

Automatically enables You can monitor on wordpress dashboard like below

redis object cache monitor wordpress kriss

 

Redis slow query log should be below 100ms average 50ms. but my case its 160ms. without redis mysql average query execution time also 100ms.

but redis causing more delay than 100ms. what’s the problem. (when content updated.)

redis performance on wordpress

2nd image no updates like post add new, or edit.

redis object cache settings wordpress

Global Groups: [
“blog-details”,
“blog-id-cache”,
“blog-lookup”,
“global-posts”,
“networks”,
“rss”,
“sites”,
“site-details”,
“site-lookup”,
“site-options”,
“site-transient”,
“users”,
“useremail”,
“userlogins”,
“usermeta”,
“user_meta”,
“userslugs”,
“redis-cache”,
“blog_meta”
]
Ignored Groups: [
“counts”,
“plugins”,
“themes”
]

Redis object cache with W3tc (wp rocket won’t support now)

 

w3tc-redis-setup-1024x305

 

after installing redis, added wp config php.

then go to w3tc general settings and enable redis cache.

 

Using persistent connection doesn’t initialize redis driver on each request

redis Object Cache - W3 Total Cache

Redis vs memcached which is best for wordpress

Memcached only supports key value, but redis support multiple data structures and replication etc.

redis is also termed as memcached on steroids check redis vs memcached

 

Cloudways redis wordpress managed no more dig

 

cloudways did a excellent jobs by managing cloud server, you don’t need to worry about server related problems like redis slow performance.

you can just start with them by 20$ per month. checkout my cloudways review pricing.

 

Monitoring redis wordpress with commands slow query

 

open termial and type

redis-cli

then slowlog get 10

 

1) (integer) 6
2) (integer) 1619161803
3) (integer) 10892  // microseconds  108 ms (ideal 50ms)
4) 1) “SET”
2) “2xpwp:posts:33996”
3) “O:8:\”stdClass\”:24:{s:2:\”ID\”;i:33996;s:11:\”post_author\”;s:1:\”1\”;s:9:\”post_date\”;s:19:\”2021-02-26 05:09:00\”;s:13:\”post_date_gmt\”;s… (4817 more bytes)”
4) “nx”
5) “127.0.0.1:17078”
6) “”
3) 1) (integer) 5
2) (integer) 1619161384
3) (integer) 17912  // 170ms
4) 1) “GET”
2) “xpwp:posts:42871”
5) “127.0.0.1:16418”
6) “”

 

Performance tips

persistent connections. (Using persistent connections to Redis means that the connection is not closed until the PHP process dies)

phpredis or predis test it for redis libraries.

find out latency in case of remote cluster (redis latency monitor disabled by default)

redis-cli –latency -p 6379 -h 127.0.0.1

root@-s-4vcpu-8gb-blr1-01:~# redis-cli –latency -p 6379 -h 127.0.0.1
min: 0, max: 12, avg: 0.31 (1382 samples)

Disable RDB persistence

Redis was saving data to disk every few minutes:

tutorials

  • Core Java Tutorial Free online
  • HTML & CSS Tutorials
  • Php tutorials
  • ubuntu tutorials installation download issues etc
  • redis install ubuntu 20.04 with wordpress php redis mysql configuration
    • redis config file location ubuntu config settings
    • redis wordpress (install, configure, tweak performance ) compared with memcached
    • redis slowlog enable disable view logs keys examples
  • [INTRO] Ethical hacking / cyber Security / Penetration testing Tutorial -{updates frequently}
  • Android Studio tutorials syllabus Topics Course details #AndroidApplicationDevelopment
  • AUdio Editing Background Noise removal (Audacity, Adobe Premiere Addition, Camtasia Filmora Windows Obs)
  • what is vpn vs proxy vs tor, http vs https, http2, tcp vs udp, kali linux sql source code injection
  • how to create a website free of cost on google
  • CCNA Syllabus pdf (CCNA / CCNP vs devops vs mcsa /MCSE)
  • Redis performance metrics & tuning for nginx apache ubuntu & debian
  • xampp tutorials 2021 installation errors fix wordpress phpmyadmin mysql apache
  • new relic installation linux (infrastructure agent , php, mysql , nginx)
  • new relic mysql install integration - 2 ways fix problems
  • new relic php agent install in 3 steps
  • aws load balancer tutorial
  • git branches merge fetch pull conflicts

hi i am raju ginni, primalry i manage wordpress websites on GCP cloud platform as a cloud engineer, and create content on passionate things.
you can follow me on youtbe

© 2025 - All Rights Reserved Disclaimer & Privacy Policy