• Resolved xninedesign

    (@x9design)


    Hi,

    I’ve encountered a situation regarding the Redis Object Cache feature in the LiteSpeed Cache plugin and would appreciate some clarification.

    In the Object Cache settings, with Redis enabled, the “Test Connection” status shows as “Passed,” indicating that the connection to Redis is working. However, I’ve noticed that even if Redis is running on the server but not configured for Object Cache, the plugin still reports that Object Cache is active simply because the connection to Redis is successful.

    This raises a concern: Is the “Test Connection” status actually confirming that Object Cache is being utilized properly by the plugin, or is it only testing the availability of Redis on the server? If the latter is true, it could lead to a misunderstanding, as many users might assume that Object Cache is working, when in reality, Redis might not be configured for caching purposes at all.

    Could you confirm if the “Test Connection” reflects actual usage of Redis for Object Cache, or just the connection status? If it’s the latter, I believe this could be a significant oversight, as many websites might not be taking full advantage of Object Cache while assuming they are.

    I’m raising this issue because my hosting support has informed me that the server doesn’t support the LSCache extension. However, in the plugin settings on my site, Redis is marked as “Enabled” and the connection test shows “Passed.” It seems the plugin is incorrectly indicating that Object Cache is active on my site.

    Thank you for your clarification on this matter!

    Best regards,
    Chris

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Support qtwrk

    (@qtwrk)

    it is for connection test only

    ?informed me that the server doesn’t support the LSCache extension

    I am not sure what is meaning of this , the LSCache and object cache are 2 different components , they work independent from each other

    a simplest way to verify object cache usage is 1) connect to redis , check info stats or keys , see if any keys in it

    or use debug log , once debug log is enabled , at bottom of html source code , you should see things like

    <!-- Page cached by LiteSpeed Cache 6.5.1 on 2024-10-07 19:29:44 -->
    <!-- X-LiteSpeed-Cache-Control: public,max-age=604800 -->
    <!-- X-LiteSpeed-Tag: 499_HTTP.200,499_home,499_URL./,499_F,499_guest,499_ -->
    <!-- Object Cache [total] 2828 [hit_incall] 2468 [hit] 0 [miss_incall] 168 [miss] 192 [set] 198 -->

    Thread Starter xninedesign

    (@x9design)

    Thank You for respond.

    So maybe i will describe how it is on my case.

    In LiteSpeed Cache plugin settings Redis is “Enabled”, connection test is “Passed”.
    But here is the only comment code from HTML source of my page.

    <!-- Page optimized by LiteSpeed Cache @2024-10-07 13:45:25 -->
    <!-- Page supported by LiteSpeed Cache 6.5.1 on 2024-10-07 13:45:24 -->
    <!-- QUIC.cloud UCSS in queue -->

    As you see there is not comment <!-- Object Cache (...) --> so it seems even if in Object Cache tab the connection type is “Passed” in reality object cache seems not working on my site.

    Where I can enable debug log? I should do this on server side or in plugins settings?

    On my hosting server I found application .log file. Here is the part of logs from running Redis app


    1913145:M 07 Oct 11:59:59.593 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
    1913145:M 07 Oct 11:59:59.593 # Server started, Redis version 3.2.12
    1913145:M 07 Oct 11:59:59.593 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
    1913145:M 07 Oct 11:59:59.597 * DB loaded from disk: 0.004 seconds
    1913145:M 07 Oct 11:59:59.597 * The server is now ready to accept connections on port 6905
    1913145:M 07 Oct 12:05:00.028 * 10 changes in 300 seconds. Saving…
    1913145:M 07 Oct 12:05:00.028 * Background saving started by pid 1931502
    1931502:C 07 Oct 12:05:00.032 * DB saved on disk
    1931502:C 07 Oct 12:05:00.032 * RDB: 0 MB of memory used by copy-on-write
    1913145:M 07 Oct 12:05:00.128 * Background saving terminated with success
    1913145:M 07 Oct 12:30:03.125 * 1 changes in 900 seconds. Saving…
    1913145:M 07 Oct 12:30:03.125 * Background saving started by pid 2020437
    2020437:C 07 Oct 12:30:03.130 * DB saved on disk
    2020437:C 07 Oct 12:30:03.130 * RDB: 0 MB of memory used by copy-on-write
    1913145:M 07 Oct 12:30:03.225 * Background saving terminated with success
    1913145:M 07 Oct 12:35:04.052 * 10 changes in 300 seconds. Saving…
    1913145:M 07 Oct 12:35:04.052 * Background saving started by pid 2040723

    Here is info about my hosting server:

    Server Architecture Linux 3.10.0-962.3.2.lve1.5.85.el7.x86_64 x86_64
    Web Server Apache
    PHP Version 8.0.30 (Supports 64-bit values)
    PHP SAPI litespeed

    Here is the quote from technical support of my hosting provider

    Redis is available, but object cache will not work because it requires the LSCache module. Therefore, we recommend not using the Litespeed Cache plugin.

    I’m a bit confused now.

    • This reply was modified 1 month, 2 weeks ago by xninedesign.
    Plugin Support qtwrk

    (@qtwrk)

    eh? did you purge all after you enable debug log ?

    Thread Starter xninedesign

    (@x9design)

    Here’s what I put into the wp-config.php file.

    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    define('WP_DEBUG_DISPLAY', false);

    In Object setting tab Redis is Enabled, Test connection is “Passed”, Purge all was used and still same in HTML source.

    <!-- Page optimized by LiteSpeed Cache @2024-10-07 14:38:35 -->

    <!-- Page supported by LiteSpeed Cache 6.5.1 on 2024-10-07 14:38:35 -->
    <!-- QUIC.cloud UCSS in queue -->

    Plugin Support qtwrk

    (@qtwrk)

    eh , no , I was meant in LiteSpeed Cache -> Toolbox -> Debug setting -> set debug log to ON , purge all , then open any front page and check comment at foot

    Thread Starter xninedesign

    (@x9design)

    Thank You.

    I got this!

    <!-- Page optimized by LiteSpeed Cache @2024-10-07 14:50:48 --> 
    <!-- Page supported by LiteSpeed Cache 6.5.1 on 2024-10-07 14:50:48 -->
    <!-- Object Cache [total] 4643 [hit_incall] 4153 [hit] 386 [miss_incall] 23 [miss] 81 [set] 76 -->
    <!-- QUIC.cloud UCSS in queue -->

    So it seems the Object Cache working on my site.
    I really don’t understand why the technical support wrote me that Object Cache need LSChache module to work when I am using your plugin.

    Plugin Support qtwrk

    (@qtwrk)

    yeah … maybe they misunderstood something…

    Thread Starter xninedesign

    (@x9design)

    Please explain something else.

    On another account of my hosting provider I successfully run Redis app in my hosting panel, but even when i use a good port number in port field at settings page of your plugin, Redis is Disabled and Test connection is “Not available”.

    I know that something is wrong with my hosting server so I try to get help from technical support.

    But here is what I get in the html source code with the above effects:

    <!-- Object Cache [total] 11923 [hit_incall] 10914 [hit] 0 [miss_incall] 132 [miss] 877 [set] 881 -->

    Please explain to me, when [hit] is 0 it means that Object Cache is not working?

    Plugin Support qtwrk

    (@qtwrk)

    yes , hit 0 means it didn’t get anything from redis

    Redis is Disabled?

    this means your PHP exntesion for redis is not enabled

    Thread Starter xninedesign

    (@x9design)

    But how does it relate to Object Cache?
    Does [hit] refer to Object Cache as well?
    In other words, if [hit] > 0, does that mean both Redis and Object Cache are working fine?

    From what I read on the internet, it is possible for Redis to be enabled on the server without Object Cache working. That’s why I need to know is a [hit] value above 0 indicates that Redis is working or if it also means Object Cache is functioning.

    Plugin Support qtwrk

    (@qtwrk)

    But how does it relate to Object Cache?

    the PHP extension for Redis , is the bridge , connects between PHP and Redis server , so without this bridge, your PHP can not communicate to Redis server , without communication , how can you save into it or get data from it ?

    • total?is the total number of objects the page requested.
    • hit_incall?is the number of objects that did not hit Redis but hit the runtime data from above.
    • hit?is the number of objects retrieved from Redis.
    • miss_incall?is the number of objects not set in runtime. That is to say, when php ran into the current line, no data was set before.
    • miss?is the number of objects not found in Redis.
    • set?is the number of objects set in Redis.

    Object cache relies on PHP exntesion for Redis, and Redis server

    object cache feature provides the API for wordpress , your wp, plugin or theme utilize such API to call object cache , then object cache , through redis extension , save data into or get data from Redis server.

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