It silently drops data. This is one of the reasons people say not to
use it as a database.
- Perrin
OMG, this must be the thread highjacking week.
--
Jose Celestino | http://japc.uncovering.org/files/japc-pgpkey.asc
----------------------------------------------------------------
"One man’s theology is another man’s belly laugh." -- Robert A. Heinlein
How would that happen? It just drops old data and replaces it with
your new stuff. It doesn't increase the overall size.
- Perrin
Sure, and I'm guessing it's not religious about making sure don't go
over the limit even a fraction, but there should be no significant
growth past the limit you set, right? And if you store more data at
that point, it should drop old data to make room for it rather than
growing.
- Perrin
Note there is a "-k" flag to memcached which, depending on underlying
OS, can lock down the pages so they won't page out to swap space. Since
your mongrel memory usage will be variable, you may be able to use that
flag to avoid a situation where memory pressure evicts memcached's pages.
Also, I don't know cruby's internals all that well, but running a quick
rails app here locally seems to show that all of the memory allocations
are in heap. Since those won't be given back until the process exits,
if you're running lots of mongrels without ever exiting you're likely
not as efficient about memory usage as you could be. I only see
a very small amount of memory mmap()'d. If things are evenly
distributed and cruby (and the underlying memory allocator you're using)
are efficient about memory allocation, it may not be too bad.
One solution for this would be to recycle the mongrels on a regular
basis. Maybe you're already doing that? There are some other solutions
too.