2. What is MEMCACHE?
Memcached is a general-purpose distributed memory caching
system.
It is used to speed up dynamic database-driven websites by
caching data and object in RAM to reduce the number of
times access data in database.
4. You got some idea .. how memcache work.
It stores the data in format of key and value in memory.
Memcached is not typically use as same machine as
application server. (it would be accessible
via sockets if it were designed to work on the same server)
and it was designed as a pooling server.
The pooling part is interesting - you can have 10 machines
running Memcached each allocating a maximum 10GB of
ram for this purpose. 10*10 = 100GB ram space.
5. How to Install Memcached For Drupal 7
This is Linux ubuntu command:-
Follow following step:-
1. Run the following command lines to install the
Memcached packages
$ sudo apt-get install memcached libmemcached-tools
$ sudo apt-get install php5-dev php-pear make
$ sudo pecl install memcache
6. Step2:
Memcached needs its own memcache.conf file in our PHP
configuration in order to run:
$ sudo nano /etc/php5/conf.d/memcache.ini
Made sure the following lines are present in this file.
extension=memcache.so
memcache.hash_strategy="consistent"
7. Step 3- Optional
The more memory we can give to Memcached the better.
The default value is 16MB, but if feasible, try allocating as
much as 1/4 of your total available RAM. To make these
changes open up memcached.conf:
$ sudo nano /etc/memcached.conf
# Change this default value to ~ 1/4 of your total
# available RAM
-m 16
8. Restart Memcached and Apache for these change to go into
effect:
$ sudo /etc/init.d/memcached restart
$ sudo /etc/init.d/apache2 restart
Now check to see if Memcached is running:
$ sudo netstat -tap | grep memcached
You should see something like:
tcp 0 0 localhost:11211 *:* LISTEN 25266/memcached
10. if you’re using a multi-site installation it’s very important to add
this to each settings.php file, changing the unique_key for
each installation:
<?php
$conf['memcache_key_prefix'] = 'unique_key';
?>
Put your site back in online-mode and you’re done! The
Memcached module also ships with an Admin submodule
which you can enable to see how Memcached is performing.
Once you’re happy with your settings I would go back and
disable this module as it is unnecessary for day to day
activities.
11. And how to tell Entity Cache to use Filecache instead of
Database Cache? Something like that?
<?php
$conf['cache_class_entity_cache'] = 'DrupalFileCache';
?>
12. I use Entity Cache and APC together:
$conf['cache_class_cache_entity_file'] = 'DrupalAPCCache';
$conf['cache_class_cache_entity_node'] = 'DrupalAPCCache';
$conf['cache_class_cache_entity_taxonomy_term'] =
'DrupalAPCCache';
$conf['cache_class_cache_entity_taxonomy_vocabulary'] =
'DrupalAPCCache';
13. Thanks
If You have any problem on same.
Please contact me:
Name: Pankaj Chauhan
pankaj.winaim@gmail.com