Archiv der Kategorie: Aapche

Debian 6 Sparc64 – Apache MEMCache

Installation:

apt-get install memcached php5-memcache

Test:

netstat -tap | grep memcached

Die IP der vi /etc/memcached.conf sollte, ebenso wie der verwendete Speicher, auf:

-l 127.0.0.1
 
-m 256

gesetzt sein …

memcached Neustarten:

/etc/init.d/memcached restart

zum Schluss Apache Neustarten:

service apache2 restart

memcache für RoundCube

folgende Abschnitte müssen in der main.inc.php angepasst werden:

// Type of IMAP indexes cache. Supported values: 'db', 'apc' and 'memcache'.
$rcmail_config['imap_cache'] = memcache;
 
// Backend to use for session storage. Can either be 'db' (default) or 'memcache'
// If set to memcache, a list of servers need to be specified in 'memcache_hosts'
// Make sure the Memcache extension (http://pecl.php.net/package/memcache) version >= 2.0.0 is installed
$rcmail_config['session_storage'] = 'memcache';
 
// Use these hosts for accessing memcached
// Define any number of hosts in the form of hostname:port or unix:///path/to/sock.file
// $rcmail_config['memcache_hosts'] = null; // e.g. array( 'localhost:11211', '192.168.1.12:11211', 'unix:///var/tmp/memcached.sock' );
$rcmail_config['memcache_hosts'] = array('localhost:11211');

memcache für Typo3

zuerst den INSTALL freischalten!

diesen Wert setzen:

Obsolete setting. Please remove manually from localconf.php, if it is defined there. Caching Framework is now always enabled.
[SYS][useCachingFramework] = 1

in der typo3conf/localconf.php müssen jetzt noch per Hand die folgenden Einträge hinzugefügt werden:

// memcache
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['cache_pages']['backend'] = 't3lib_cache_backend_MemcachedBackend';
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['cache_pages']['options'] = array(
        'servers' => array('localhost:11211'),
);
 
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['cache_pagesection']['backend'] = 't3lib_cache_backend_MemcachedBackend';
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['cache_pagesection']['options'] = array(
        'servers' => array('localhost:11211'),
);
 
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['cache_hash']['backend'] = 't3lib_cache_backend_MemcachedBackend';
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['cache_hash']['options'] = array(
        'servers' => array('localhost:11211'),
);
 
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['cache_pages']['frontend']= 't3lib_cache_frontend_VariableFrontend';
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['cache_pagesection']['frontend']= 't3lib_cache_frontend_VariableFrontend';
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['cache_hash']['frontend']= 't3lib_cache_frontend_VariableFrontend';
// memcache

Getestet unter Typo3 4.7

… mittels top -u nobody könnt ihr den wachsenden Speicherverbrauch von memcached beobachten …