How to enable Memcached

Connection

To activate go to Services. Access to the service "Memcached is through a socket. Pathsearch services on the order page.

It is important! To connect the balance should be sufficient for one month's use of the service.

Tariffication

We do not take into account the "Memcached" in resource usage. For service you payseparately — money debited each day.

Cost

  • 128 MB RAM $ 0.05 / day, to connect to the account should be $1.5;
  • 256 MB RAM $ 0.10 / day, to connect to the account should be $3;
  • 512 MB RAM $ 0.20 / day, to connect to the account should be $6.

Examples of using Memcached

Native

$memcached = new Memcached();
$memcached->addServer('/home/uXXX/.services/site.ru.sock', 0);
$memcached->set('key', 'value');
var_dump($memcached->getAllKeys());

Laravel

To work with Memcached in Laravel use a special provider Memcached. You must activateand add access to the socket:

'memcached' => [
  [
    'host' => '/home/uXXX/.services/site.ru.sock',
    'port' => 0,
    'weight' => 100,
  ],
],

To activate the Memcached set in the configuration file. "env" as follows:

CACHE_DRIVER=memcached

Symfony2

Symfony2 have a Special bundle aequasi/memcached-bundle. The installation processdescribed on the page in the repository. Use the default settings, changing only the "hosts":

hosts: - {host: /home/uXXX/.services/site.ru.sock, port: 0, weight: 100}

Drupal

Install Drupal module Memcache. Add at the end of the file "sites/default/settings.php" as follows:

$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['memcache_servers'] = array(
  'unix:///home/uXXX/.services/site.ru.sock' => 'default',
);

Codeigniter 3

To connect to the file "application/config/memcached.php" set settings:

$config = array(
  'default' => array(
    'hostname' => '/home/uXXX/.services/site.ru.sock',
    'port' => 0,
    'weight' => 1,
  ),
);