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?
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...
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.
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: