Hi

I've been running a series of small tests against a recent install of
memcached 1.2.5 - and am getting some cache retrieval inconsistencies. Can
anyone help ?

I'm using Cache::Memcache perl API.

I run the server as follows:-

$ memcached -d -m 3072 -L -l 10.xxx.xxx.xx -p 11211 -vv


I've then run up a client Perl program to connect to this memcached service

            my $cache = Cache::Memcached->new({'servers' => [
"10.xxx.xxx.xx:11211" ]});

            $cache->set("1_" . $rec->{id}, \$rec1, 12*60*60);
            $cache->set("2_" . $rec->{id} . "_" . $rec2->{legId}, \$rec2,
12*60*60);
            $cache->set("3_" . $rec->{id} . "_1", \$rec3, 12*60*60);
            $cache->set("4_" . $rec->{id}, \$rec4, 12*60*60);
            $cache->set("5_" . $rec->{id}, \$rec5, 12*60*60);


where $rec->{id} = 1951931
   $rec1, $rec2, $rec3, $rec4, $rec5 are all perl hash structures

Memcached daemon reports:

<8 new client connection
<8 set 1_1951931 1 43200 461
>8 STORED
<8 set 2_1951931_1 1 43200 261
>8 STORED
<8 set 3_1951931_1 1 43200 151
>8 STORED
<8 set 4_1951931 1 43200 86
>8 STORED
<8 set 5_1951931 1 43200 97
>8 STORED
<9 new client connection
<9 get 5_1951931
>9 END
<9 connection closed.


I then run a client up to query for each of the 5 key/value pairs BUT some
of the queries fail

<9 new client connection
<9 get 1_1951931
>9 END
<9 connection closed.
<9 new client connection
<9 get 4_1951931
>9 END
<9 connection closed.
<9 new client connection
<9 get 2_1951931_1
>9 sending key 2_1951931_1
>9 END
<9 connection closed.
<9 new client connection
<9 get 3_1951931_1
>9 sending key 3_1951931_1
>9 END


Here is the client perl code
   my ($cache) = Cache::Memcached->new({'servers' => [ "10.135.131.12:11211"
]});
    my ($cacheKey) = "1_1951931";
    my ($obj1) = $cache->get($cacheKey);

    my ($cacheKey) = "1_1951931";
    my ($obj1) = $cache->get($cacheKey);




I've made several test versions - where I've changed the key content
structure - and have observed that I still get failures but for differing
keys.

This definitely suggests a problem with the hashing algorithm used on the
key ?  (I should also state that all perl code and memcached daemon are
running on the same machine).


Can anyone help here ?

Thanks in advance
Paul

Reply via email to