[TYPO3-core] FYI72: #15497: [Caching framework] Remove tagIndex from memcached and apc backend

Christian Kuhn lolli at schwarzbu.ch
Thu Aug 19 01:35:53 CEST 2010


The following patch will be committed in 72 hours if nobody objects:

Type: Performance improvement

Branches: trunk, 4.4, 4.3

BT: http://bugs.typo3.org/view.php?id=15497 [^]
FLOW3 issue: http://forge.typo3.org/issues/8918 [^] (committed)

Problem:
The memcached and apc backend implementations currently store this 
key-value "structure" to map our identifier-data-keys relation:
     * identifier -> data
     * identifier -> keys
     * key -> identifiers
     * tagIndex -> All known tags

The tagIndex doesn't have any benefit at all, it just leads to more 
set() and get() calls.

Solution:
Completely remove tagIndex to save some operations which speeds up the 
backends, unit tests still show green bar.

Numbers:
Performance tests of memcached backend show that the backend speeds up 
between 10 to 100% by removing the tagIndex. As an example, attached 
images show a test which set()'s a raising number of cache entries with 
a single attached tag to the backend. More numbers can be generated with 
ext:enetcacheanalytics (forge) in v4.

Notes:
- Memcache is a simple key-value store and not designed to store 
structures of multiple related entries. Our implementation is a misuse, 
which leads to corrupt caches if memcache evicts entries from cache 
(because it needs space for new elements), or if single servers fail in 
a multi server environment.
- APC backend implementation is pretty much identical to the memcache 
implementation, it's just affected by this change as well, but it's not 
benchmarked on it's own here.

Regards
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 15497_01.diff
Type: text/x-patch
Size: 5351 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100819/fc315d48/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cacheBackendMemcachedBackend_removeTagIndex_after.png
Type: image/png
Size: 23951 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100819/fc315d48/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cacheBackendMemcachedBackend_removeTagIndex_before.png
Type: image/png
Size: 23595 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100819/fc315d48/attachment-0003.png>


More information about the TYPO3-team-core mailing list