Hi all, 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: [code] 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 [/code] dbmrec.txt contains 31196 lines of record like: lwatch 38535 netwox-doc 70502 octave-audio 92312 octave-informationtheory 92004 pyrenamer 5049 ruby1.9-examples 13590 safecat 74989 It needs around 25s to successfully terminate compare to 0.5s forthe same program using tokyocabinet. So, my question is, am I missing something? This will be even slower than normal sql insert/select I guess. Thanks for any comment. Difei -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Sep 18, 1:19 am, Difei Zhao <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Kevin Peterson wrote:> On Sep 18, 1:19�am, Difei Zhao <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> � 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. > > KevinHi, 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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---