There appears to be a bug in SMF 1.1.19
If you disable APC (Server Settings > Caching > Caching Level > No Caching), SMF still attempts to 'fetch' non-existent user cache entries. It completely throws off the 'Hits / Misses' stats for 'User Cache Information' in APC.php - which I (and many others) use to keep track of issues / performance.
If you modify "Sources/Load.php" file and comment out lines #2164 & #2165, it solves the issue.
elseif (function_exists('apc_fetch'))
$value = apc_fetch($key . 'smf');
I don't have a busy forum, but nonetheless, the code above is causing a "Miss Rate: 1.48 cache requests/second" in the 'User Cache' section - which makes it impossible for me to keep track of my personal php scripts APC stats.
Better question... if caching is disabled why hasn't cache_get_data() already returned?
A few lines above that:
if (empty($modSettings['cache_enable']) && !empty($modSettings))
return;
Since cache level 0 (no caching) would put a value of 0 into cache_enable, that empty() would be true... so it should be exiting before that and never calling apc_fetch.
Quote from: Arantor on May 21, 2014, 03:24:19 PM
Better question... if caching is disabled why hasn't cache_get_data() already returned?
A few lines above that:
if (empty($modSettings['cache_enable']) && !empty($modSettings))
return;
Since cache level 0 (no caching) would put a value of 0 into cache_enable, that empty() would be true... so it should be exiting before that and never calling apc_fetch.
That's a good question - but that's definitely not happening here. I have to comment those 2 lines out in order for it to stop.
Do you know where I can find that cache setting in the SMF database?
Perhaps it's enabled in there, but showing as disabled (for some reason) in the admin panel.
EDIT: SMF_Settings > cache_enable is set to 0.
Then there is no reason for it even to get to that point unless something else very weird is going on...
Oh. I just realised what's going on. There is one time the cache will be called for without $modSettings being declared which is what the empty() test on $modSettings is for - it can be called to load $modSettings itself from cache.
Yes, this is a known defect of SMF 1.x, and if I remember rightly in 2.0 as well but it has been fixed in 2.1. Changing it in a mainstream release of the nearly-deprecated 1.1 isn't going to happen though.
Ok, thanks for letting me know.
I'll leave it commented out until I am able to upgrade to 2.1
Quote from: MobileCS on May 21, 2014, 05:02:56 PM
Ok, thanks for letting me know.
I'll leave it commented out until I am able to upgrade to 2.1
you should look to upgrade to 2.0 first. 2.1 may be many months away from a stable release where 2.0 has been stable for several years.
If it's been fixed in 2.1, I'll just move this topic away then.