i''m reading about memcached, which i never used before. it seems really interesting, but i found discording informations about it (and rails). a) what is a reasonable memory usage for memcached? i read on some sites ~1gb while the default on my ubuntu server is only 64mb. i understand it''s application dependent, but do you think that 128mb should be enough for most sites? b) what about compression? it gives more cache hits, but is it performance costly? c) i need a time based fragment expirations. i read about http://agilewebdevelopment.com/plugins/memcache_fragments_with_time_expiry but it return me a "plugin not found" error. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.
> a) > what is a reasonable memory usage for memcached? > i read on some sites ~1gb while the default on my ubuntu server is > only 64mb. i understand it''s application dependent, but do you think > that 128mb should be enough for most sites?It completely depends on your application. I''ve run sites that had 4 servers with 1gb each, I''ve run sites that have 64mb... you need to figure out how much data you need to store. Start with 64 and let it run for a bit. Then connect to the memcache server and run ''stats'' to get some data on how it''s doing. Scroll down till you see the stat definition table... http://github.com/memcached/memcached/blob/master/doc/protocol.txt> b) > what about compression? it gives more cache hits, but is it > performance costly?compression? Not sure what you mean. Memcached is very fast. Most people use it because their db isn''t fast enough or to lighten the load...> > c) > i need a time based fragment expirations. i read about > http://agilewebdevelopment.com/plugins/memcache_fragments_with_time_expiry > but it return me a "plugin not found" error.You shouldn''t need a plugin to get going... add this to your environment.rb (or one of the specific ones in environments) config.cache_store = :mem_cache_store, "localhost", {:namespace => ''foobar''} Then in your views you can do things like: <% cache(:some_unique_key, :expires_in => 15.minutes) do %> complicated html goes here... <% end %> And all the other caching stuff as well... -philip -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.
On 19 Nov, 23:41, Philip Hallstrom <phi...-LSG90OXdqQE@public.gmane.org> wrote:> compression? Not sure what you mean. Memcached is very fast. Most > people use it because their db isn''t fast enough or to lighten the > load...it is an memcached options. but i''m not so convinced about it e.g.: memcache_options = { :compression => true, :namespace => "foobar", :readonly => false, } i think the idea is to store more data on the cache. but compression/ decompression may slow down the process... if i don''t find out something i will do a benchmark about it.> > > c) > > i need a time based fragment expirations. i read about > >http://agilewebdevelopment.com/plugins/memcache_fragments_with_time_e... > > but it return me a "plugin not found" error. > > You shouldn''t need a plugin to get going... add this to your > environment.rb (or one of the specific ones in environments) > > config.cache_store = :mem_cache_store, "localhost", {:namespace => > ''foobar''} > > Then in your views you can do things like: > > <% cache(:some_unique_key, :expires_in => 15.minutes) do %> > complicated html goes here... > <% end %>great. thank you for your answer. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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=.
Well, you could use something like CloudCache and not worry about allocation - it''s elastic. There''s a drop-in implementation for the ActiveSupport::Cache interface: http://github.com/quetzall/cloud_cache/ Of course that''s best used if you''re on EC2 (or EngineYard on EC2). m On Thu, Nov 19, 2009 at 2:41 PM, Philip Hallstrom <philip-LSG90OXdqQE@public.gmane.org> wrote:> > a) > > what is a reasonable memory usage for memcached? > > i read on some sites ~1gb while the default on my ubuntu server is > > only 64mb. i understand it''s application dependent, but do you think > > that 128mb should be enough for most sites? > > It completely depends on your application. I''ve run sites that had 4 > servers with 1gb each, I''ve run sites that have 64mb... you need to > figure out how much data you need to store. Start with 64 and let it > run for a bit. Then connect to the memcache server and run ''stats'' to > get some data on how it''s doing. Scroll down till you see the stat > definition table... > http://github.com/memcached/memcached/blob/master/doc/protocol.txt > > > b) > > what about compression? it gives more cache hits, but is it > > performance costly? > > compression? Not sure what you mean. Memcached is very fast. Most > people use it because their db isn''t fast enough or to lighten the > load... > > > > > c) > > i need a time based fragment expirations. i read about > > > http://agilewebdevelopment.com/plugins/memcache_fragments_with_time_expiry > > but it return me a "plugin not found" error. > > You shouldn''t need a plugin to get going... add this to your > environment.rb (or one of the specific ones in environments) > > config.cache_store = :mem_cache_store, "localhost", {:namespace => > ''foobar''} > > Then in your views you can do things like: > > <% cache(:some_unique_key, :expires_in => 15.minutes) do %> > complicated html goes here... > <% end %> > > And all the other caching stuff as well... > > -philip > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=. > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.
CloudCache is a paid service, btw. $0.05/MB/month. But they''re offering: "Free 5 MB cache until Nov. 1, 2009!" Hmm. dwh Marc Byrd wrote:> Well, you could use something like CloudCache and not worry about > allocation - it''s elastic. There''s a drop-in implementation for the > ActiveSupport::Cache interface: > > http://github.com/quetzall/cloud_cache/ > > Of course that''s best used if you''re on EC2 (or EngineYard on EC2). > > m >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.