INSTALL MEMCACHED IN WORDPRESS

Wordpress LogoIf you install Memcached on WordPress and use a multi-server setup, you can simply reduce the DB queries by 50%. If you are interest and want to give it a try, you can simply install the plugin by following our step-by-step tutorial.

How To Install Memacached:

  1. Install Memcached using this command: sudo apt-get install memcached.
  2. After the installation finishes, you will have to configure Memcached by using a .conf file: vi /etc/memcached.conf.
  3. As you will notice, in the configuration file there will be some parameters. You can leave as default the -d, -u and logfile parameters. Please be careful and change the -m, -p and -i values for your servers. The -l parameter value has to be replaced from 127.0.0.1 to an address of your server. After you have finished configuring enter this command: service memcached restart or /etc/init.d/memcached restart.

How to use Memcached on WordPress:

Next thing to do is to setup WordPress so it can save files using Memcached. You have to follow this address ( www.wordpress.org/extend/plugins/memcached ) and install the plugin for WordPress. Keep in mind that you have to copy the files into the wp-content directory and not in the plugins directory.

In order to make Memcached work, you will also have to install another plugin called PECL ( which is a Memcached extension ). You can download it from www.peck.php.net/package/memcache. Now is time to setupWordPress to make us of the Memcached plugin. Please open the wp-config file and enter this command:

global $memcached_servers; $memcached_servers = array(‘default’ => array(‘memcache-server-ip-or-name:11211?));

0 comments:

Post a Comment