"Total hits" in Memcache statistics table are always at 0%. Does my memcache work?

Created on 20 December 2023, 6 months ago
Updated 21 December 2023, 6 months ago

I have followed all info inside readme file. I have enabled the Memcache admin module and here is how all the listings below loaded pages look like in my case:

Memcache statistics
operation	total ms	total hits	total misses
get		0.41		0 (0.0%)	22 (100.0%)
set		93.62		0 (0.0%)	2,977 (100.0%)
getMulti	76.66		0 (0.0%)	1,295 (100.0%)

After I have loaded the same page multiple times the "Total hits" column is always the same showing 0% hits. And the page load is not fast. So, is this a sign that the memcache is not actually working on my website? Or memcache is not working for logged-in admins?

My config:
D10.2.0
Memcache module 8.x-2.5
cpanel memcache is disabled
cpanel memcached is enabled
phpinfo() is showing Memcached Version 3.1.5
settings.php record added: $settings['cache']['default'] = 'cache.backend.memcache';

The status report is clean showing like everything is fine. And the Memcache reports below loaded pages are working. Just the "Total hits" data is always at 0%.

πŸ’¬ Support request
Status

Closed: cannot reproduce

Version

2.0

Component

Code

Created by

πŸ‡­πŸ‡·Croatia devad

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @devad
  • πŸ‡­πŸ‡·Croatia devad
  • πŸ‡­πŸ‡·Croatia devad
  • πŸ‡­πŸ‡·Croatia devad
  • πŸ‡­πŸ‡·Croatia devad
  • πŸ‡­πŸ‡·Croatia devad
  • πŸ‡«πŸ‡·France fgm Paris, France

    Makes me wonder if you actually installed a Memcached server service, added the memcached or memcache php extension, and configured them as described in the module README.

  • πŸ‡­πŸ‡·Croatia devad

    Thanks for reply @fgm.

    It's a shared sever with cPanel.

    These screenshots may help:

    - cPanel PHP extensions screenshot
    - Status page screenshot
    - phpinfo() screenshot
    - Memcache statistics (turned on by Memcache admin module) screenshot

  • πŸ‡­πŸ‡·Croatia devad

    BTW... one more question.

    I couldn't find any information regarding core "Internal Page Cache" and "Internal Dynamic Page Cache" modules when using Memcache.

    Should I uninstall this two core modules or should they stay installed? Or it doesn't matter?

  • πŸ‡«πŸ‡·France fgm Paris, France

    IPC and DPC are just modules implementing specific cache bins. They will be in memcache if you configured the site in the basic memcache configuration.

    I just did a fresh install to check and I just get 100% hits on get/set and 92% on getMulti.

    One thing I've noticed from helping with the elijaa/phpmemcacheadmin project is that over time, Memcached (the daemon) changes the implementation of the debug information and admin tools like the Memcache Admin module (or in my case phpmemcacheadmin) have to support multiple versions of the debug schema. It could be that the version of memcached on your machine does not match the one supported by this module.

    You could try checking your memcached instance with phpmemcached admin or any other tool just to be sure they also show 0% hits. If they also show 0, the problem is probably in your Drupal configuration. If they show nonzero, it's probably a mismatch between your Memcached daemon version, the extension, and the Drupal code.

    Looks like you will have to do some debugging to do. And beware, because this is something which will vary from one infrastructure to another. You could very well have the problem on a given cPanel hosting and not have it when debugging locally on your machine, for example.
    And/or wonder if maybe you could just not be using memcached, which is something useful only on the biggest sites (multi-million hits/day).

    Smaller ones tend to fare well with the core DB cache, actually; or Redis for medium-large ones.

    If you really need Memcached and cannot perform that debugging, some companies can provide this kind of debugging, like Tag1, 2Bits Inc., or my own OSInet.

  • Status changed to Closed: cannot reproduce 6 months ago
  • πŸ‡­πŸ‡·Croatia devad

    Thank you so much @fgm for your elaborated reply.

    I have a rather small site, so switching back to db cache makes a lot of sense.

    I'll close this issue as "Cannot reproduce", and maybe someone else will open it again in the future if he/she experience the same issue.

    Thanks again! Have a nice holydays!

Production build 0.69.0 2024