Bug #8918

memcached backend: Remove tagIndex

Added by Christian Kuhn about 5 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2010-08-16
Priority:Should have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:Cache
Target version:TYPO3 Flow Base Distribution - 1.0 alpha 11
PHP Version: Complexity:
Has patch: Affected Flow version:

Description

Problem:
The memcached backend implementation currenty stores 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:
Completly remove tagIndex to save some operations which speeds up this backend, unit tests still show green bar.

Numbers:
Performance tests 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.

cacheBackendMemcachedBackend_removeTagIndex_after.png (23.4 kB) Christian Kuhn, 2010-07-17 19:29

cacheBackendMemcachedBackend_removeTagIndex_before.png (23 kB) Christian Kuhn, 2010-07-17 19:29

cacheBackendMemcachedBackend_removeTagIndex_flow3.diff Magnifier (2.6 kB) Christian Kuhn, 2010-07-17 19:29

cacheBackendMemcachedBackend_removeTagIndex_v4.diff Magnifier (2.6 kB) Christian Kuhn, 2010-07-17 19:29

Associated revisions

Revision 924bf567
Added by Karsten Dambekalns almost 5 years ago

[+BUGFIX] FLOW3 (Cache): Removed tagIndex from memcache and APC backends, fixes #8918. Thanks to Christian Kuhn.

Change-Id: I6ee52676aa5db78bfa5410b296c94e99d5c41c1a

History

#1 Updated by Karsten Dambekalns almost 5 years ago

  • Status changed from New to Accepted
  • Assigned To set to Karsten Dambekalns
  • Start date deleted (2010-07-17)

#2 Updated by Karsten Dambekalns almost 5 years ago

  • Target version set to 1.0 alpha 11
  • Start date set to 2010-08-16

#3 Updated by Karsten Dambekalns almost 5 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r4974.

Also available in: Atom PDF