Cache::Memcached::Fast is a Perl client for memcached, a memory cache daemon. It is designed to be a "drop in" replacement for Cache::Memcached, original pure Perl client, but is implemented in C language for speed and has very low CPU consumption. Among its distinct features are:
- Custom implementation of the Ketama consistent hashing algorithm.
- Hooks for custom serialization and compression routines.
- Proper save/restore of non-ASCII Perl strings.
- noreply and nowait modes that reduces command latency when you are not interested in the server reply.
- Multi-update commands that reduce cumulative latency by sending several requests in one network packet and talking to all servers simultaneously.
Latest release is 0.19 (released on 2010-04-24).
Download from CPAN
Git repository ( browse, snapshot): git clone git://openhack.ru/Cache-Memcached-Fast.git
Mailing list for users and developers:
- Archive: http://list.openhack.ru/Lists/talk/
- Subscribe: talk-on@…
- Unsubscribe: talk-off@…
News
2010-04-24
Cache::Memcached::Fast 0.19 has been released. New SIGPIPE suppression code has been reverted because no system could benefit from it.
2010-04-06
Cache::Memcached::Fast 0.18 has been released. Module is made Perl thread aware, fixed Solaris bug with multi-commands, and implemented handling of Perl magic (tied variables).
2009-11-02
Cache::Memcached::Fast 0.17 has been released. delete and delete_multi no longer handle delay parameter (this was an incompatible change in memcached 1.3.2).
2009-06-15
Cache::Memcached::Fast 0.16 has been released. 0.15 has been released this day too, but it turned out it missed some files, so it was quickly replaced with 0.16. This release doesn't affect existing users, no need to upgrade. It updates test case to satisfy memcached 1.3.3 that now expects numeric value in the cache for incr/decr commands, and fixes compilation on Windows lacking getaddrinfo().
2009-02-07
Cache::Memcached::Fast 0.14 has been released. Improved distribution of servers in Ketama algorithm (making Ketama mode incompatible with previous releases).
2008-10-13
Cache::Memcached::Fast 0.13 has been released. Introduced Win32 support (thanks to Yasuhiro Matsumoto). Internally we now use poll() instead of select() for benefit of applications that open lots of files in addition to connections to memcached servers.
2008-07-21
Cache::Memcached::Fast 0.12 has been released. It fixes compilation on Solaris broken in 0.11.
2008-07-17
Cache::Memcached::Fast 0.11 has been released. It fixes %zu format problem on Solaris (thanks to Michael Vychizhanin for investigation). Added new parameter max_size.
2008-05-01
Cache::Memcached::Fast 0.10 has been released. It fixes a bug in key distribution in Cache::Memcached compatibility mode (thanks to Anton Yuzhaninov for the report).
2008-03-12
Because of a stupid mistake hash_namespace parameter works only when namespace is set with namespace() method. Namespace specified in the constructor is never hashed. This will be fixed in 0.10, which will be released after memcached community will agree on Ketama implementation compatible across all clients.
2008-03-06
Cache::Memcached::Fast 0.09 has been released. noreply mode is an official feature of memcached 1.2.5, and is made public in C::M::F. Added new method namespace() and new parameter hash_namespace. Also C::M::F now manages TCP_NODELAY flag to reduce the latency of certain command patterns.
2008-02-22
Added new method namespace to get and optionally set the namespace prefix.
2008-02-01
noreply mode has been documented. To be used with memcached-patched.
2008-01-27
ngx_http_upstream_memcached_hash_module 0.01 is available for download.
2008-01-25
In the archive uploaded to CPAN in the script/benchmark.pl the undocumented noreply mode has been left enabled by mistake. This does not affect the module itself, but if you are going to run this script you will have to set NOREPLY => 0 in it.
With Perl 5.6.x encoding.t fails because encoding pragma first appears in Perl 5.8.0. This is a bug in the test case, and the failure is safe wrt. the module itself.
2008-01-24
Cache::Memcached::Fast 0.08 has been released. This is mostly a cleanup release, but it also features improved decompression speed.
2008-01-19
Due to the careless use of Newx() macro C::M::F 0.07 fails to compile with Perl version 5.8.6 and below. If you have the affected version of Perl you may pull the fix from the Git tree, or apply the following patch:
diff --git a/Fast.xs b/Fast.xs
index ef252d2..d24109c 100644
--- a/Fast.xs
+++ b/Fast.xs
@@ -595,7 +595,7 @@ _new(class, conf)
PREINIT:
Cache_Memcached_Fast *memd;
CODE:
- Newx(memd, 1, Cache_Memcached_Fast);
+ memd = (Cache_Memcached_Fast *) malloc(sizeof(Cache_Memcached_Fast));
memd->c = client_init();
if (! memd->c)
croak("Not enough memory");
2008-01-18
Cache::Memcached::Fast 0.07 has been released. All Perl code has been converted to XS which gave a significant speed improvement. New features are:
- Hooks for custom serialization routines.
- Proper save/restore of non-ASCII Perl strings.
- Multi-update commands that reduce cumulative latency by sending several requests in one network packet and talking to all servers simultaneously.
Now you can write:
$memd->set_multi([$k1, $v1], [$k2, \@list], @key_val_pairs); $memd->incr_multi(@counters, ['cnt', 3]); $memd->delete_multi(@keys);
