WPCloudDeploy Documentation

Object Cache: MemCached

Introduction

An object cache can help speed up database queries by caching the results of those queries in memory.  One of the most popular object cache is MemCached.  Support for this is included as part of the core WPCloudDeploy plugin.

An additional object cache option is REDIS.  REDIS is installed by default on all new servers.

Enabling MemCached

To enable MemCached, the package first needs to be installed at the server level.  Once it’s installed, you can then enable it on a site-by-site basis.

Install the MemCached Package

  • Go to WPCloudDeploy → All Cloud Servers
  • Click on the server where you’ll be installing MemCached
  • Scroll down to the MEMCACHED section
  • Click the Install MemCached button

A popup will appear that will offer periodic feedback as the process progresses.  When the process is complete you will get a popup confirmation message and the black ‘terminal” window will show the actions that were taken while attempting to install the package.

Activate MemCached For A Site

Once MemCached has been installed on a server you can activate it for any site on the server.

  1. Go to WPCloudDeploy → All Apps (or WPCloudDeploy → WordPress Sites)
  2. Click on the site where you need to turn on the object cache
  3. Click on the Cache tab
  4. Scroll down to the MEMCACHED section
  5. Click on the toggle switch

After a while the screen will refresh – if the operation is successful.  If the operation fails, you’ll get a popup message.

You can view a full log of the operation under the SSH LOG screen.

Deactivate MemCached For A Site

  1. Go to WPCloudDeploy → All Apps
  2. Click on the site where you need to turn on the object cache
  3. Click on the Cache tab
  4. Scroll down to the MEMCACHED section
  5. Click on the toggle switch

After a while the screen will refresh – if the operation is successful.  If the operation fails, you’ll get a popup message.

You can view a full log of the operation under the SSH LOG screen.

Clear The MemCached Cache

Once in a while you might find the need to clear out the cache.  Doing this will clear the cache for all sites on the server.

  • Go to WPCloudDeploy → All Cloud Servers
  • Click on the affected server
  • Scroll down to the MEMCACHED section
  • Click the Clear Cache button

After a while the screen will refresh – if the operation is successful.  If the operation fails, you’ll get a popup message.

You can view a full log of the operation under the SSH LOG screen.

Removing MemCached From The Server

Warning: Before removing MemCached from the server, make sure you deactivate it from all sites on the server.  Otherwise, you’ll see heavy delays when you access your site because WordPress will be attempting to connect to a non-existent MemCached server.

To remove it:

  • Go to WPCloudDeploy → All Cloud Servers
  • Click on the affected server
  • Scroll down to the MEMCACHED section
  • Click on the UNINSTALL MEMCACHED button.

If this procedure does not work, you can remove it using the command line on the server.


Visual Tweaks

You can apply a label next to the titles on the SERVER and SITES list that show which object cache (Redis or Memcached) is enabled.  To turn this on:

  • Go to WPCloudDeploy → SETTINGS → APP: WORDPRESS – SETTINGS
  • Click on the GENERAL tab on the left side
  • Scroll down to the LABELS section
  • Enable the SHOW THE OBJECT SERVER label checkbox
  • Scroll down and click the SAVE SETTINGS button.

Share: