Recent patches

Brian Moon brianm at
Mon Nov 12 05:52:40 UTC 2007

> Ok, Tomash supplied me with a clean patch list.  Now, I need some 
> memslap help to know what I should test.  I ran a few, but as I have 
> never used it, I have no idea what to use.   Also, is there a test 
> script that uses the perl client that could test the noreply stuff?

Well, hacked up a perl script to test the noreply stuff.  Now, I don't 
use the perl interface really at all.  So, if this script sucks, please 
tell me.  Script is at the end.

100,000 sets, 10,000 gets:

current trunk:


Interestingly, if I did assign the return of the set method, both went 
up to 14.* seconds.  Seems the perl assignment is the slow part there, 
not waiting on a reply.  This was over the wire btw.  Two identical dual 
core opteron boxes.  One running the memcached daemons and one running 
the tests.

I ran some PHP tests too.  Of course, there is no "noreply" support, but 
the stats were basically identical.  Same with the memslap tests I ran. 
  I could not get much more than two lines of output from memslap and 
anything over 500 concurrents seemed to cause segfaults on a 
semi-regular basis.

use strict;
use warnings;
use Time::HiRes qw( usleep ualarm gettimeofday tv_interval );
# timing example from
use Cache::Memcached;
my $memd = new Cache::Memcached {
'servers' => [ "" ],
'debug' => 0,
'compress_threshold' => 10_000,
my $content = "";
my $ret = "";

my $start = [gettimeofday];
for (0..100000) {
     $memd->set("key_$_", "X" x rand(1000));
my $end = [gettimeofday];
my $elapsed = tv_interval($start, $end);
print "$elapsed\n";

$start = [gettimeofday];
for (0..10000) {
     $content = $memd->get("key_$_");
$end = [gettimeofday];
$elapsed = tv_interval($start, $end);
print "$elapsed\n";


Brian Moon
Senior Developer
It's good to be cheap =)

More information about the memcached mailing list