• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Input How to setup redis and use it as object-cache backend for WordPress

I am getting following in docker :

[0m[1mWelcome to the Bitnami redis container[0m
[0mSubscribe to project updates by watching [1mhttps://github.com/bitnami/bitnami-docker-redis[0m
[0mSubmit issues and feature requests at [1mhttps://github.com/bitnami/bitnami-docker-redis/issues[0m
[0m
Error executing 'postInstallation': Files to substitute resolved to an empty list

how to resolve this error???
 
there is object-cache.php in wp-content folder, i am using WP fastest Cache an auto-optimize.

There may have some incompatibilities between WP fastest Cache and Redis-Object-Cache, but do you use a plugin named Transient Cleaner ?
Because Transient Cleaner isn't compatible with an external object-cache.


Sorry I haven't seen there was new posts after this one.

But to answer to your question about the deployment of bitnami-docker-redis, are you trying to setup another VPS for redis ?
 
Last edited:
How do I see Redis RAM usage by Bitnami/redis docker image

Hello @Jaber Al Nahian, you just have to click on the container name in Plesk and it will dispay the container logs and RAM usage :

docker-redis.png
 
@vitubox

really a good example, do you have an example how to use nginx with redis as cache (nginx.conf) and Plesk, without using php now is well?
or is redis cache with php the better solution?

thanks in advance

MK

Code:
:/etc/nginx# nginx -V
nginx version: nginx/1.14.1 (VirtuBox Nginx-ee)
built by gcc 7.3.0 (Ubuntu 7.3.0-23ubuntu2~16.04.york0)
built with OpenSSL 1.1.1  11 Sep 2018
TLS SNI support enabled
configure arguments: --add-module=/usr/local/src/naxsi/naxsi_src --with-cc-opt='-m64 -march=native -DTCP_FASTOPEN=23 -g -O3 -fstack-protector-strong -flto -fuse-ld=gold --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wimplicit-fallthrough=0 -fcode-hoisting -Wp,-D_FORTIFY_SOURCE=2 -gsplit-dwarf' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' --prefix=/usr/share --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --modules-path=/usr/share/nginx/modules --build='VirtuBox Nginx-ee' --user=nginx --group=nginx --without-http_uwsgi_module --without-mail_imap_module --without-mail_pop3_module --without-mail_smtp_module --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_v2_module --with-http_mp4_module --with-http_sub_module --with-file-aio --with-threads --with-zlib=/usr/local/src/zlib --add-module=/usr/local/src/ngx_cache_purge --add-module=/usr/local/src/headers-more-nginx-module --add-module=/usr/local/src/memc-nginx-module --add-module=/usr/local/src/ngx_devel_kit --add-module=/usr/local/src/ngx_brotli --add-module=/usr/local/src/echo-nginx-module --add-module=/usr/local/src/ngx_http_substitutions_filter_module --add-module=/usr/local/src/redis2-nginx-module --add-module=/usr/local/src/srcache-nginx-module --add-module=/usr/local/src/set-misc-nginx-module --add-module=/usr/local/src/ngx_http_redis --add-module=/usr/local/src/ngx_http_auth_pam_module --add-module=/usr/local/src/nginx-module-vts --add-module=/usr/local/src/ipscrubtmp/ipscrub --add-module=/usr/local/src/incubator-pagespeed-ngx-latest-stable --with-openssl=/usr/local/src/openssl --with-openssl-opt='enable-ec_nistp_64_gcc_128 enable-tls1_3' --with-zlib=/usr/local/src/zlib --sbin-path=/usr/sbin/nginx
 
@vitubox

really a good example, do you have an example how to use nginx with redis as cache (nginx.conf) and Plesk, without using php now is well?
or is redis cache with php the better solution?

thanks in advance

MK

Code:
:/etc/nginx# nginx -V
nginx version: nginx/1.14.1 (VirtuBox Nginx-ee)
built by gcc 7.3.0 (Ubuntu 7.3.0-23ubuntu2~16.04.york0)
built with OpenSSL 1.1.1  11 Sep 2018
TLS SNI support enabled
configure arguments: --add-module=/usr/local/src/naxsi/naxsi_src --with-cc-opt='-m64 -march=native -DTCP_FASTOPEN=23 -g -O3 -fstack-protector-strong -flto -fuse-ld=gold --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wimplicit-fallthrough=0 -fcode-hoisting -Wp,-D_FORTIFY_SOURCE=2 -gsplit-dwarf' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' --prefix=/usr/share --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --modules-path=/usr/share/nginx/modules --build='VirtuBox Nginx-ee' --user=nginx --group=nginx --without-http_uwsgi_module --without-mail_imap_module --without-mail_pop3_module --without-mail_smtp_module --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_v2_module --with-http_mp4_module --with-http_sub_module --with-file-aio --with-threads --with-zlib=/usr/local/src/zlib --add-module=/usr/local/src/ngx_cache_purge --add-module=/usr/local/src/headers-more-nginx-module --add-module=/usr/local/src/memc-nginx-module --add-module=/usr/local/src/ngx_devel_kit --add-module=/usr/local/src/ngx_brotli --add-module=/usr/local/src/echo-nginx-module --add-module=/usr/local/src/ngx_http_substitutions_filter_module --add-module=/usr/local/src/redis2-nginx-module --add-module=/usr/local/src/srcache-nginx-module --add-module=/usr/local/src/set-misc-nginx-module --add-module=/usr/local/src/ngx_http_redis --add-module=/usr/local/src/ngx_http_auth_pam_module --add-module=/usr/local/src/nginx-module-vts --add-module=/usr/local/src/ipscrubtmp/ipscrub --add-module=/usr/local/src/incubator-pagespeed-ngx-latest-stable --with-openssl=/usr/local/src/openssl --with-openssl-opt='enable-ec_nistp_64_gcc_128 enable-tls1_3' --with-zlib=/usr/local/src/zlib --sbin-path=/usr/sbin/nginx

Hello,
Nginx-ee build include nginx_http_redis & redis2-nginx modules, so it's possible to use redis directly with Nginx instead of fastcgi_cache.
Inside a standard nginx vhost (without plesk) it will look like :

Code:
server { 
 
- - - 

location /redis-fetch {
    internal  ;
    set  $redis_key $args;
    redis_pass  redis;
}
location /redis-store {
    internal  ;
    set_unescape_uri $key $arg_key ;
    redis2_query  set $key $echo_request_body;
    redis2_query expire $key 14400;
    redis2_pass  redis;
}

location ~ \.php$ {
  set $key "nginx-cache:$scheme$request_method$host$request_uri";
  try_files $uri =404;

  srcache_fetch_skip $skip_cache;
  srcache_store_skip $skip_cache;

  srcache_response_cache_control off;

  set_escape_uri $escaped_key $key;

  srcache_fetch GET /redis-fetch $key;
  srcache_store PUT /redis-store key=$escaped_key;

  more_set_headers 'X-SRCache-Fetch-Status $srcache_fetch_status';
  more_set_headers 'X-SRCache-Store-Status $srcache_store_status';

  include fastcgi_params; 
  fastcgi_pass php72;
}

But with Plesk it will require to edit Plesk virtualhost templates. You can find more informations in the Plesk documentation : A WordPress website on a Plesk server shows "404 Not Found" on all pages except index.php, when running on FPM by nginx
I'm already working on a custom template with Nginx fastcgi_cache available on Github : VirtuBox/plesk-nginx-fascgi-cache-template
But it's not fully ready for production (cache is shared between all subscription, there is no isolation at the moment).
 
thanks @virtubox for this quick Demo :)

Did you maybe do a performance test with siege? I can not tell the difference on my test system (Wordpress+WooCommerce)


Code:
 siege -c50 -d10 -t3M https://**********.eu
Standard Settings php7.2 fpm with apache2.4 and Nginx Cache
Transactions:                   1816 hits
Availability:                 100.00 %
Elapsed time:                 179.75 secs
Data transferred:             130.58 MB
Response time:                  0.01 secs
Transaction rate:              10.10 trans/sec
Throughput:                     0.73 MB/sec
Concurrency:                    0.09
Successful transactions:        1816
Failed transactions:               0
Longest transaction:            0.70
Shortest transaction:           0.00

Nginx php7.2 fast-cgi
Transactions:                   1347 hits
Availability:                 100.00 %
Elapsed time:                 179.42 secs
Data transferred:             106.27 MB
Response time:                  1.61 secs
Transaction rate:               7.51 trans/sec
Throughput:                     0.59 MB/sec
Concurrency:                   12.08
Successful transactions:        1347
Failed transactions:               0
Longest transaction:            4.66
Shortest transaction:           0.23

I did not try nginx with redis cache, I'm hoping for a real performance.
how can i test if nginx with redis is working properly?

thanks in advance
Manuel
 
Back
Top