Feature Request #1802

MemcacheD-based Cache driver (multiple servers)

Added by Oleh Zamkovyi almost 4 years ago. Updated over 3 years ago.

Status:Closed Start date:06/23/2009
Priority:High Due date:
Assignee:Kiall Mac Innes % Done:

0%

Category:Libraries:Cache
Target version:2.4
Resolution:worksforme Points:

Description

There are 2 extensions provides an interface to memcached:

Using memcached, we get the opportunity to work with multiple servers.
So, the following code does not make sense (Memcache-based Cache driver):

        $servers = Kohana::config('cache_memcache.servers');

        foreach ($servers as $server)
        {
            // Make sure all required keys are set
            $server += array('host' => '127.0.0.1', 'port' => 11211, 'persistent' => FALSE);

            // Add the server to the pool
            $this->backend->addServer($server['host'], $server['port'], (bool) $server['persistent'])
                or Kohana::log('error', 'Cache: Connection failed: '.$server['host']);
        }

And added property "prefix. This is done to ensure that common names do not overlap at different sites

Memcached.php (4.1 kB) Oleh Zamkovyi, 06/23/2009 12:37 pm

cache_memcached.php (464 Bytes) Oleh Zamkovyi, 06/23/2009 12:37 pm

Memcached.php (4.1 kB) Oleh Zamkovyi, 06/25/2009 01:06 pm

cache_memcached.php (475 Bytes) Oleh Zamkovyi, 06/25/2009 01:06 pm


Related issues

related to Posix File Cache Driver - Feature Request #1752: File Cache directory level Assigned 06/04/2009
related to Kohana v2.x - Feature Request #723: Cache should allow memcache multi_get for performance 2.4 Closed
duplicated by Kohana v2.x - Bug Report #724: Allow multiple server groups in cache_memcache.php config... 2.4 Closed

Associated revisions

History

Updated by Oleh Zamkovyi almost 4 years ago

Updated by Oleh Zamkovyi almost 4 years ago

Updated by Jeremy Bush almost 4 years ago

  • Priority changed from Normal to Low
  • Resolution deleted (worksforme)

Can any of the devs test this?

Updated by Jeremy Bush almost 4 years ago

  • Status changed from New to Review

Updated by Ben Rogers almost 4 years ago

i agree this should be implemented, one of memcache's strengths is the fact you can load balance it

Updated by Kiall Mac Innes over 3 years ago

  • Tracker changed from Bug Report to Feature Request

Updated by Jeremy Bush over 3 years ago

  • Status changed from Review to Assigned
  • Assignee set to Kiall Mac Innes
  • Priority changed from Low to High

Updated by Kiall Mac Innes over 3 years ago

  • Resolution set to worksforme

Both the memcache and memcacheD ext's support multiple servers.

I've updated the memcache driver to make use of multiple servers correctly. A memcacheD driver will not be included in the core (why maintain two!). If your willing to maintain the memcacheD driver, I can setup a project here on redmine for it.

Updated by Kiall Mac Innes over 3 years ago

  • Status changed from Assigned to Closed

Updated by Kiall Mac Innes over 3 years ago

Humm - looks like I committed a memcacheD driver by mistake (I'll likely remove it before we release) see #723 for the details...

most importantly:

I also wrote up a memcacheD based driver and compared the new memcache driver to this one - memcacheD was
slower for everything bar multi set."

Also available in: Atom PDF