Feature Request #1802

MemcacheD-based Cache driver (multiple servers)

Added by Oleh Zamkovyi over 5 years ago. Updated over 5 years ago.

Status:ClosedStart date:06/23/2009
Priority:HighDue 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 Magnifier (4.09 KB) Oleh Zamkovyi, 06/23/2009 12:37 PM

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

Memcached.php Magnifier (4.14 KB) Oleh Zamkovyi, 06/25/2009 01:06 PM

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


Related issues

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

Associated revisions

History

#1 Updated by Oleh Zamkovyi over 5 years ago

#2 Updated by Oleh Zamkovyi over 5 years ago

#3 Updated by Jeremy Bush over 5 years ago

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

Can any of the devs test this?

#4 Updated by Jeremy Bush over 5 years ago

  • Status changed from New to Review

#5 Updated by Ben Rogers over 5 years ago

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

#6 Updated by Kiall Mac Innes over 5 years ago

  • Tracker changed from Bug Report to Feature Request

#7 Updated by Jeremy Bush over 5 years ago

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

#8 Updated by Kiall Mac Innes over 5 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.

#9 Updated by Kiall Mac Innes over 5 years ago

  • Status changed from Assigned to Closed

#10 Updated by Kiall Mac Innes over 5 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