Feature #21614
closedAdd support for MemCache
0%
Description
ADOdb supports MemCache for queries: http://phplens.com/lens/adodb/docs-adodb.htm#memcache
See how this may be used within DBAL and TYPO3.
(issue imported from #M12668)
Updated by Xavier Perseguers over 14 years ago
Just as info here. I originally thought of something else when reading ADOdb documentation. But I finally gave it a try with something else.
A branch has been created:
https://svn.typo3.org/TYPO3v4/Extensions/dbal/branches/QueryCache
Basically what I (quickly) did is to store the complete query rewrite into MemCached. This is very very very experimental as no query are parametrized in Core, making MemCached store lots of "same" rewritten query again and again.
However on a demo site, this is way quicker once a query has been seen once before. Just test with EM and a click on an extension... It normally takes ages to show the details of the extension, but with this code, starting from second time showing the details of an extension, you end up having no more time to grab a cup of coffee during the loading process. Sorry :-)
To make a long story short, if we ever manage to start parametrize Core queries (by supporting parametrized queries in t3lib_db I'd say), this branch could become trunk and DBAL could start being possibly quite much more efficient.
Updated by Xavier Perseguers over 14 years ago
PDO syntax seems OK: http://api.drupal.org/api/group/database/7 (documentation from Drupal where they use it already)
Updated by Xavier Perseguers over 14 years ago
Branch QueryCache for DBAL has just been updated and synchronized with trunk:
http://forge.typo3.org/projects/extension-dbal/repository/show/branches/QueryCache
Have a look!
Updated by Xavier Perseguers over 14 years ago
To use it, edit localconf.php:
Without memcached (not optimal but already better than no caching):
$TYPO3_CONF_VARS['SYS']['useCachingFramework'] = 1;
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['dbal'] = array(
'backend' => 't3lib_cache_backend_TransientMemoryBackend',
'options' => array(
),
);
Note: you may omit the configuration at all, as long as useCachingFramework is active, caching will default to t3lib_cache_backend_TransientMemoryBackend
For memcached, use:
$TYPO3_CONF_VARS['SYS']['useCachingFramework'] = 1;
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['dbal'] = array(
'backend' => 't3lib_cache_backend_MemcachedBackend',
'options' => array(
'servers' => array('localhost:11211', 'otherhost:11211', 'thirdhost:11211'), // port is mandatory!
)
);
You need to have memcached installed as a daemon and also as a PHP extension!
Updated by Xavier Perseguers about 14 years ago
Branch QueryCache has been merge into trunk as revision 38370.