Skip to content
 

Storing Sessions With Memcache

Storing Sessions With Memcache

Drupal memcache can have stunning improvements on server resources. There are certain steps which can be performed to ensure the proper running of the server if memcache API module is used.
1. Tables should not be stored completely on database.
2. The necessary memcache instances and bins should be configured.
3. Sessions should be stored with memcache.
4. Memcache should be monitored to check if it is working properly or not.
Storing sessions with memcache is an important step for a high traffic site. Drupal stores sessions into database. Moving it to memcache is helpful. Below is the code which is used for storing sessions in a database with memcache:
$conf = array(
'cache_inc' => 'modules/memcache/memcache.inc',
'session_inc' => 'modules/memcache/memcache-session.inc',
'memcache_servers' => array('10.1.1.1:11211' => 'default',
'10.1.1.1:11212' => 'default',
'10.1.1.2:11211' => 'default',
'10.1.1.3:11211' => 'cluster2',
'10.1.1.4:11211' => 'cluster2'
'memcache_bins' => array('cache' => 'default', 'users' =>'cluster2,
'cache_filter' => 'cluster2','session' => 'session')

);
There will be spectacular changes by using memcache.


Leave a Reply