Project

General

Profile

Actions

Bug #28514

closed

t3lib_cache_backend_MemcachedBackend's tag-to-identifier and vice-versa is a performance chugger

Added by Raphaël Riel almost 13 years ago. Updated about 11 years ago.

Status:
Rejected
Priority:
Won't have this time
Assignee:
-
Category:
Caching
Target version:
-
Start date:
2011-07-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.6
PHP Version:
5.3
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

Description

Using the standard class for Memcached Caching, it does takes 10 calls to memcache to do a single SET operation.

I've added error_log statements for every call made by this class to memcached. See attached class.

Here an excerpt of the resulting log. I've isolated two SETs :

SET set() normal fr_SphinxSearchPluginController-indexConfigKeyValueAssoc
GET findTagsByIdentifier() fr_SphinxSearchPluginController-indexConfigKeyValueAssoc
DELETE removeIdentifierFromAllTags() fr_SphinxSearchPluginController-indexConfigKeyValueAssoc
GET findIdentifiersByTag() fr
SET addIdentifierToTags() fr_SphinxSearchPluginController-indexConfigKeyValueAssoc
GET findTagsByIdentifier() fr_SphinxSearchPluginController-indexConfigKeyValueAssoc
SET addIdentifierToTags() fr_SphinxSearchPluginController-indexConfigKeyValueAssoc
GET findIdentifiersByTag()SET set() normal fr_SphinxSearchPluginController-indexConfigKeyValueAssoc
GET findTagsByIdentifier() fr_SphinxSearchPluginController-indexConfigKeyValueAssoc
DELETE removeIdentifierFromAllTags() fr_SphinxSearchPluginController-indexConfigKeyValueAssoc
GET findIdentifiersByTag() fr
SET addIdentifierToTags() fr_SphinxSearchPluginController-indexConfigKeyValueAssoc
GET findTagsByIdentifier() fr_SphinxSearchPluginController-indexConfigKeyValueAssoc
SET addIdentifierToTags() fr_SphinxSearchPluginController-indexConfigKeyValueAssoc
GET findIdentifiersByTag() %MEMCACHEBE%st_zone_mvc
SET addIdentifierToTags() fr_SphinxSearchPluginController-indexConfigKeyValueAssoc
GET findTagsByIdentifier() fr_SphinxSearchPluginController-indexConfigKeyValueAssoc

//[...]

SET set() normal fr_user_zone_cat_menu-getRootlineDataForUid-159062
GET findTagsByIdentifier() fr_user_zone_cat_menu-getRootlineDataForUid-159062
DELETE removeIdentifierFromAllTags() fr_user_zone_cat_menu-getRootlineDataForUid-159062
GET findIdentifiersByTag() fr
SET addIdentifierToTags() fr_user_zone_cat_menu-getRootlineDataForUid-159062
GET findTagsByIdentifier() fr_user_zone_cat_menu-getRootlineDataForUid-159062
SET addIdentifierToTags() fr_user_zone_cat_menu-getRootlineDataForUid-159062
GET findIdentifiersByTag() %MEMCACHEBE%st_zone_mvc
SET addIdentifierToTags() fr_user_zone_cat_menu-getRootlineDataForUid-159062
GET findTagsByIdentifier() fr_user_zone_cat_menu-getRootlineDataForUid-159062
 %MEMCACHEBE%st_zone_mvc
SET addIdentifierToTags() fr_SphinxSearchPluginController-indexConfigKeyValueAssoc
GET findTagsByIdentifier() fr_SphinxSearchPluginController-indexConfigKeyValueAssoc

//[...]

SET set() normal fr_user_zone_cat_menu-getRootlineDataForUid-159062
GET findTagsByIdentifier() fr_user_zone_cat_menu-getRootlineDataForUid-159062
DELETE removeIdentifierFromAllTags() fr_user_zone_cat_menu-getRootlineDataForUid-159062
GET findIdentifiersByTag() fr
SET addIdentifierToTags() fr_user_zone_cat_menu-getRootlineDataForUid-159062
GET findTagsByIdentifier() fr_user_zone_cat_menu-getRootlineDataForUid-159062
SET addIdentifierToTags() fr_user_zone_cat_menu-getRootlineDataForUid-159062
GET findIdentifiersByTag() %MEMCACHEBE%st_zone_mvc
SET addIdentifierToTags() fr_user_zone_cat_menu-getRootlineDataForUid-159062
GET findTagsByIdentifier() fr_user_zone_cat_menu-getRootlineDataForUid-159062

<pre>

There another big issue with this tag/identifier saving process; and that the reason of my custom rewrite of this class. When flushing the cache on our Live servers where almost all of the data was cached, we ran into PHP's 30seconds timeout every time we were hitting the "clear-custom-cache" button in the admin section.

I have written two classes in an attempt to fix this; please see attached in .tar.gz file:
* Regular: Trying to keep the current system, but reduce the calls and fix the timeout problem. public remove() implementation had to the dropped...
* Aggressive: No longer doing anything with tags or saving any identifier... Clearing caching is done using version number appended to cache key... This class leaves all older entries in memcached. The deamon has its own way to ensure free space, so I didn't bothered to empty it...

Files

Actions

Also available in: Atom PDF