How to Use Memcached
How to Use Memcached
The Memcached system is employed by high-traffic websites such as YouTube, Facebook, and Twitter, providing fast data caching to improve performance. It is also supported by popular CMS platforms like WordPress, Joomla, and Drupal.
To use Memcached with PHP, enable the Memcached extension via your hosting control panel:
- Navigate to Advanced → PHP Settings
- Edit php.ini and turn memcached On
If your plan doesn't include Memcached instances, you can purchase them as an upgrade through the Add/Upgrade service(s) section of the hosting control panel. Each instance includes 16 MB of memory, enabling efficient caching for your application.
Important: Many applications need a host and port to connect with Memcached. In our system, Memcached operates on a socket rather than a port.
To configure Memcached, use the following details:
Memcached Hostname (IP): unix:///home/sys/memcached.sock
Memcached Port: 0
Example code for PHP:
$memcached->addServer('unix:///home/sys/memcached.sock', 0);
Tags: addServer, CMS, Control Panel, Drupal, high-traffic sites, hosting Control Panel, Joomla, Memcached, Memcached extension, Memcached hostname, Memcached instances, memcached.sock, PHP, PHP settings, port, unix socket, upgrade, web applications, WordPress