• I’m using docker, and I have redis in a different container
    Caching works correctly, redis is in the list of available caching methods
    But in the logs, I still see a huge amount of notifications from your plugin (when I disable it, everything stops)

    in php logs:


    NOTICE: PHP message: Connection refused
    NOTICE: PHP message: Connection refused
    NOTICE: PHP message: Connection refused
    NOTICE: PHP message: Connection refused

    As far as I understand, regardless of the settings

    ;php.ini
    [redis]
    redis.host = “redis”
    redis.port = 6379

    and

    // wp-config.php
    define('W3TC_CONFIG_CACHE_ENGINE', 'redis');
    define('W3TC_CONFIG_CACHE_REDIS_SERVERS', 'redis:6379');

    The plugin still tries to check redis on localhost
    Maybe the memcach check also generates this log

    Is there any way to remove the redis/memcache check attempt when the frontend page is loaded, or any other admin page (except your plugin)?
    It is possible to optimize and not check for every php request?

    But that’s ok, why is it trying to knock on the localhost next? Is it possible to fix it?
    Maybe I didn’t specify some other variable?

    The main problem for me is flooding in the logs, I want to get rid of it without moving redis to localhost, in a container with wordpress

    • This topic was modified 1 month, 3 weeks ago by vellnes.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @vellnes

    Thank you for reaching out and for taking the time to share this.

    We’ll need to test this and check this more. Once I have more information about this I’ll get back to you with and answer

    Thanks!

    Thread Starter vellnes

    (@vellnes)

    Hello @vmarko
    Maybe there are some updates?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @vellnes

    Sorry for the late reply. What you are reffering to is

    for configuration items being stored in Redis, not the Page or other caches.

    See ini/config-db-sample.php

    https://github.com/BoldGrid/w3-total-cache/wiki/FAQ:-Installation:-Redis-Server#redis-setup

    Just to confirm, this is what you are trying to do?

    Thanks!

    Thread Starter vellnes

    (@vellnes)

    Hello @vmarko

    I hooked up the radis without using this config.
    And there was a log of endless attempts to connect to redis on localhost

    I tried to add it (/wp-content/plugins/w3-total-cache/ini/config-db.php, right?) — nothing changed.
    Below is the content of the configuration that I made

    define('W3TC_CONFIG_DATABASE', true);

    define('W3TC_CONFIG_CACHE_ENGINE', 'redis');
    define('W3TC_CONFIG_CACHE_REDIS_SERVERS', 'redis:6379');
    define('W3TC_CONFIG_CACHE_REDIS_VERIFY_TLS_CERTIFICATES', false);

    Using the command tcpdump -i any port 6379 inside the container with WP, I get a long log of how the plugin tries to check the connection to redis and fails to find it (a successful connection to another redis is also visible, there the data exchange is normal)
    After disabling the w3tc plugin, this log is gone

    17:10:17.773500 lo    In  IP localhost.60380 > localhost.6379: Flags [S], seq 599777928, win 65495, options [mss 65495,sackOK,TS val 1088607838 ecr 0,nop,wscale 7], length 0
    17:10:17.773504 lo In IP localhost.6379 > localhost.60380: Flags [R.], seq 0, ack 1437402834, win 0, length 0
    17:10:17.775904 lo In IP localhost.60396 > localhost.6379: Flags [S], seq 2333168516, win 65495, options [mss 65495,sackOK,TS val 1088607840 ecr 0,nop,wscale 7], length 0
    17:10:17.775909 lo In IP localhost.6379 > localhost.60396: Flags [R.], seq 0, ack 610208718, win 0, length 0
    17:10:17.777802 lo In IP localhost.60404 > localhost.6379: Flags [S], seq 3700970019, win 65495, options [mss 65495,sackOK,TS val 1088607842 ecr 0,nop,wscale 7], length 0
    17:10:17.777806 lo In IP localhost.6379 > localhost.60404: Flags [R.], seq 0, ack 551556151, win 0, length 0
    17:10:17.777867 lo In IP localhost.60406 > localhost.6379: Flags [S], seq 2215180403, win 65495, options [mss 65495,sackOK,TS val 1088607842 ecr 0,nop,wscale 7], length 0
    17:10:17.777870 lo In IP localhost.6379 > localhost.60406: Flags [R.], seq 0, ack 2025716921, win 0, length 0

    I tried making changes to the following files, but still attempts to connect to localhost remain

    /plugins/w3-total-cache/ini/config-db-sample.php
    /plugins/w3-total-cache/ini/config-db.php
    /plugins/w3-total-cache/Extension_FragmentCache_Plugin.php
    /plugins/w3-total-cache/ConfigKeys.php
    /w3tc-config/master.php - After saving the settings in the admin, the file is overwritten. After making my changes, it still doesn't take them into consideration(

    Also I tried to get more information for you, I modified the Redis_Cache.php file by adding my code to it

    error_log("================================");
    error_log("Config - " . json_encode($config));
    error_log("================================");

    ...

    error_log("================================");
    error_log("Key - " . json_encode($key));
    error_log("Accessors - " . json_encode($this->_accessors));
    error_log("Servers - " . json_encode($this->_servers));
    error_log("Redis server - $server");
    error_log("================================");

    Below is an example of output, when exactly the plugin knocks on localhost, it turns out redis caching is not working correctly, because it still tries to look for values on localhost for DB Cache and Object Cache caching.

    NOTICE: PHP message: ================================
    NOTICE: PHP message: Config - {"servers":["127.0.0.1:6379"],"verify_tls_certificates":true,"persistent":true,"timeout":0,"retry_interval":0,"read_timeout":0,"dbid":0,"password":"","blog_id":0,"module":"object","host":"debug.roses.ee","instance_id":219741501}
    NOTICE: PHP message: ================================
    NOTICE: PHP message: ================================
    NOTICE: PHP message: Key - "w3tc_219741501_debug.roses.ee_0_object_0defaultis_blog_installed"
    NOTICE: PHP message: Accessors - []
    NOTICE: PHP message: Servers - ["127.0.0.1:6379"]
    NOTICE: PHP message: Redis server - 127.0.0.1:6379
    NOTICE: PHP message: ================================
    NOTICE: PHP message: ================================
    NOTICE: PHP message: Key - "w3tc_219741501_debug.roses.ee_0_object_0optionsalloptions"
    NOTICE: PHP message: Accessors - [null]
    NOTICE: PHP message: Servers - ["127.0.0.1:6379"]
    NOTICE: PHP message: Redis server - 127.0.0.1:6379
    NOTICE: PHP message: ================================

    ...

    NOTICE: PHP message: ================================
    NOTICE: PHP message: Config - {"servers":["redis:6379"],"verify_tls_certificates":true,"persistent":true,"dbid":0,"password":"","timeout":0,"retry_interval":0,"read_timeout":0,"key_version_mode":"disabled","blog_id":"0","module":"config","host":"","instance_id":0}
    NOTICE: PHP message: ================================
    NOTICE: PHP message: ================================
    NOTICE: PHP message: Key - "w3tc_0__0_config_w3tc_config_0"
    NOTICE: PHP message: Accessors - []
    NOTICE: PHP message: Servers - ["redis:6379"]
    NOTICE: PHP message: Redis server - redis:6379
    NOTICE: PHP message: ================================

    ...

    NOTICE: PHP message: ================================
    NOTICE: PHP message: Config - {"servers":["127.0.0.1:6379"],"verify_tls_certificates":true,"persistent":true,"timeout":0,"retry_interval":0,"read_timeout":0,"dbid":0,"password":"","module":"dbcache","host":"debug.roses.ee","instance_id":219741501,"blog_id":0}
    NOTICE: PHP message: ================================
    NOTICE: PHP message: ================================
    NOTICE: PHP message: Key - "w3tc_219741501_0_dbcache_options_key_version"
    NOTICE: PHP message: Accessors - []
    NOTICE: PHP message: Servers - ["127.0.0.1:6379"]
    NOTICE: PHP message: Redis server - 127.0.0.1:6379
    NOTICE: PHP message: ================================
    NOTICE: PHP message: ================================
    NOTICE: PHP message: Key - "w3tc_219741501_debug.roses.ee_0_object_0optionscron"
    NOTICE: PHP message: Accessors - [null]
    NOTICE: PHP message: Servers - ["127.0.0.1:6379"]
    NOTICE: PHP message: Redis server - 127.0.0.1:6379
    NOTICE: PHP message: ================================
    NOTICE: PHP message: ================================
    NOTICE: PHP message: Key - "w3tc_219741501_debug.roses.ee_0_object_0optionsalloptions"
    NOTICE: PHP message: Accessors - [null]
    NOTICE: PHP message: Servers - ["127.0.0.1:6379"]
    NOTICE: PHP message: Redis server - 127.0.0.1:6379
    NOTICE: PHP message: ================================

    Is it coming out that the plugin can’t be configured to a custom host at this point? Or how can I do that?
    No matter what I try, I get the same result, the plugin knocks on localhost
    Maybe you can tell me where I’m wrong, or what I need to fix.
    Or where these settings for each plugin are pulled from, where the localhost is specified.

    I really need help with the correct configuration.
    Even if I have to change something in the plugin files, or in the database.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @vellnes

    I am not sure what you are trying to achieve actutaly
    Are you trying to store config in the DB or use Redis as a caching method?
    Thanks!

    Thread Starter vellnes

    (@vellnes)

    Hello @vmarko

    I’m trying to show the plugin that redis is there, but not on localhost
    Without any customization, the plugin can’t see redis

    How can I configure caching using redis (with custom url)?
    I would be grateful for a detailed response

    Thread Starter vellnes

    (@vellnes)

    I finally found the problem
    In my redis settings, in the advanced settings of each caching method – I had to specify the path to redis in the admin area
    Previously, I did not notice this setting, and there by default 127.0.0.1

    Initially, the plugin did not see redis at all, so I could not select the redis caching method.
    So I couldn’t change these settings.
    After I added:

    define('W3TC_CONFIG_CACHE_ENGINE', 'redis');
    define('W3TC_CONFIG_CACHE_REDIS_SERVERS', 'redis:6379');

    I started to see redis as a caching method, but it still didn’t work, because of those advanced settings in admin panel

    Please make the redis path setting global, at the top level of the plugin settings, or the ability to configure this parameter within each caching method, without selecting redis (because in the beginning with my configuration, the plugin didn’t see redis at all)

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.