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 <phi...@pjkh.com> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com<rubyonrails-talk%2bunsubscr...@googlegroups.com>
> .
> 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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=.


Reply via email to