There is a new plugin for memcached query cache, I was hoping it will
bring some performance boost for my application, so I write a simple
ruby program to benchmark normal memcached performance, the result is
very frustrating:
require 'memcache'
CACHE = MemCache.new('localhost:11211')
def mem_write
File.open("./dbmrec.txt", "r") do |f|
while line = f.gets
str, num = line.split(' ')
CACHE[str] = num
end
end
end
There is a new plugin for memcached query cache, I was hoping it will
bring some performance boost for my application, so I write a simple
ruby program to benchmark normal memcached performance, the result is
very frustrating:
…
while line = f.gets
str, num = line.split(’ ')
CACHE[str] = num
end
…
So, my question is, am I missing something? This will be even slower
than normal sql insert/select I guess.
I don’t think repeated writes with no reads is a very good performance
test for memcached. Test reading instead. I’d test by populating the
cache to something that would look like steady state (i.e. you don’t
want all your data in cache, because that’s unrealistic, but you don’t
want to start empty), then starting the clock and doing lots of reads,
some of which will be cache misses and have to go to DB.
� There is a new plugin for memcached query cache, I was hoping it will
bring some performance boost for my application, so I write a simple
ruby program to benchmark normal memcached performance, the result is
very frustrating:
…
� � while line = f.gets
� � � str, num = line.split(’ ')
� � � CACHE[str] = num
� � end
…
� So, my question is, am I missing something? This will be even slower
than normal sql insert/select I guess.
I don’t think repeated writes with no reads is a very good performance
test for memcached. Test reading instead. I’d test by populating the
cache to something that would look like steady state (i.e. you don’t
want all your data in cache, because that’s unrealistic, but you don’t
want to start empty), then starting the clock and doing lots of reads,
some of which will be cache misses and have to go to DB.
Kevin
Hi, I was using Ruby-Memcached, after changing it to memcached-client,
the speed is now much faster (3s), but it still can not beat
tokyocabinet.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.