Re: memcache client very slow?

Philip Hallstrom
2007-09-14T17:41:37Z

On Fri, 14 Sep 2007, Marc Byrd wrote:

> Case 1:  Ruby + Ruby-MemCache + onboard memcache (the cache) - 10.5 seconds
>
> Case 2:  Python + REMOTE memcache (the same cache as the other) -
0.2seconds
>
> Please please tell me I''m doing something very wrong... - and
examples of
> the right way would be great.

Try memcache-client instead...

http://dev.robotcoop.com/Libraries/memcache-client/index.html

It''s supposed to be a lot faster...

Also, if this is on a mac and you''re using memcache 1.2.0 recompile it
and
tweak the following:

# edit memcached.h and add ''#undef NO_TCPPUSH'' to the top

Can''t remember where exactly I read that, but it makes a huge
difference.


>
> m
> --
> here''s my code:
>
> require ''memcache''
>
>
> mem = MemCache.new ''10.253.9.158''
> #mem = MemCache.new ''127.0.0.1''
>
> t1=Time.new
> list1 = mem[''red'']
> list2 = mem[''car'']
> t2=Time.new
> puts (t2.to_f - t1.to_f).to_s
>
> list3 = list1.split('':'') &
list2.split('':'')
> t3 = Time.new
> puts (t3.to_f - t2.to_f).to_s
> puts list3
> t4 = Time.new
> puts (t4.to_f - t3.to_f).to_s
>
> >
>