New PHP extension for Memcached

13 views
Skip to first unread message

pcdinh

unread,
Jan 29, 2009, 2:57:51 PM1/29/09
to memcached
Andrei Zmievski, one of key men behind Unicode support in PHP6 has
released a new PHP extension for interfacing with memcached via
libmemcached library

Check it out at http://pecl.php.net/package/memcached

To my best knowledge, there are 3 PHP extensions that are based on
libmemcached so far

Brian Aker

unread,
Jan 29, 2009, 3:02:23 PM1/29/09
to memc...@googlegroups.com
There are a couple of in-house ones I know of as well :)

--
_______________________________________________________
Brian "Krow" Aker, brian at tangent.org
Seattle, Washington
http://krow.net/ <-- Me
http://tangent.org/ <-- Software
_______________________________________________________
You can't grep a dead tree.

steve.yen

unread,
Jan 30, 2009, 2:49:50 PM1/30/09
to memcached
Added a link to the wiki -- http://code.google.com/p/memcached/wiki/Clients

On Jan 29, 12:02 pm, Brian Aker <br...@tangent.org> wrote:
> There are a couple of in-house ones I know of as well :)
>
> On Jan 29, 2009, at 11:57 AM, pcdinh wrote:
>
> > Andrei Zmievski, one of key men behind Unicode support in PHP6 has
> > released a new PHP extension for interfacing with memcached via
> > libmemcached library
>
> > Check it out athttp://pecl.php.net/package/memcached
>
> > To my best knowledge, there are 3 PHP extensions that are based on
> > libmemcached so far
>
> --
> _______________________________________________________
> Brian "Krow" Aker, brian at tangent.org
> Seattle, Washingtonhttp://krow.net/                    <-- Mehttp://tangent.org/               <-- Software

aniketh patrick

unread,
Jan 31, 2009, 12:40:28 AM1/31/09
to memc...@googlegroups.com
On Fri, Jan 30, 2009 at 1:27 AM, pcdinh <pcd...@gmail.com> wrote:
> To my best knowledge, there are 3 PHP extensions that are based on
> libmemcached so far

Hello,

Are they any extensions that work with the same hash strategies as the
libmemcached extension. Last time I checked, PHP and C were putting
objects on different servers, although a fix was posted for PHP and
python interoperatibility.

Regards,
Aniketh

pcdinh

unread,
Feb 2, 2009, 1:30:57 AM2/2/09
to memcached
Yet another PHP extension for libmemcached has been released
http://pecl.php.net/package/libmemcached

This extension is developed by Daisuke Kajiwara at
http://github.com/kajidai/php-libmemcached/tree

Also, check out his blog at http://d.hatena.ne.jp/kajidai/


On Jan 31, 2:49 am, "steve.yen" <steve....@gmail.com> wrote:
> Added a link to the wiki --http://code.google.com/p/memcached/wiki/Clients

shiqi yang

unread,
Feb 2, 2009, 2:10:58 AM2/2/09
to memc...@googlegroups.com
hi all,

anyone test it? how about it?


Sincerely,

erik

Jones, Richard W

unread,
Feb 2, 2009, 6:53:43 AM2/2/09
to memc...@googlegroups.com
Hi,
I've been testing this new memcached extension that uses libmemcached.

The payload flags for compressed and serialized are backwards, the "standard" is for bit 0 to denote serialized and bit 1 to denote compressed, I changed the values in php_memcached.c to:
#define MEMC_VAL_SERIALIZED (1<<0)
#define MEMC_VAL_COMPRESSED (1<<1)

All clients except python seem to agree on this: http://www.hjp.at/zettel/m/memcached_flags.rxml

I've also made a slight change to libmemcached to make the ketama-hashing support compatible with libketama. I consider this a bug in libmemcached and will send them a patch too. If anyone else needs ketama compatible hashing in this php extension, make this change [1] to libmemcached.

Thanks for releasing this, a php extension using libmemcached is long overdue :)

Regards,
RJ

[1] patch for libmemcached for ketama compatability (always include port in hash-key):

rj@rj ~/libmemcached-0.26
$ diff libmemcached/memcached_hosts.c.orig libmemcached/memcached_hosts.c
160c160
< pointer_per_server= floorf(pct * MEMCACHED_POINTS_PER_SERVER_KETAMA / 4 * (float)(ptr->number_of_hosts) + 0.0000000001) * 4;
---
> pointer_per_server= floorf(pct * MEMCACHED_POINTS_PER_SERVER_KETAMA * (float)(ptr->number_of_hosts));
175,185c175,176
< if (list[host_index].port == MEMCACHED_DEFAULT_PORT)
< {
< sort_host_length= snprintf(sort_host, MEMCACHED_MAX_HOST_SORT_LENGTH, "%s-%d",
< list[host_index].hostname, index - 1);
<
< }
< else
< {
< sort_host_length= snprintf(sort_host, MEMCACHED_MAX_HOST_SORT_LENGTH, "%s:%d-%d",
< list[host_index].hostname, list[host_index].port, index - 1);
< }
---
> sort_host_length= snprintf(sort_host, MEMCACHED_MAX_HOST_SORT_LENGTH, "%s:%d-%d",
> list[host_index].hostname, list[host_index].port, index - 1);

Brian Aker

unread,
Feb 2, 2009, 12:17:35 PM2/2/09
to memc...@googlegroups.com
Please send the patch :)

Cheers,
--Brian

pcdinh

unread,
Feb 2, 2009, 9:23:30 PM2/2/09
to memcached
Please check out new version of memcached
http://pecl.php.net/package-changelog.php?package=memcached

Andrei seems to address this issue in the latest version
Reply all
Reply to author
Forward
0 new messages