Yes, as mentioned, it is a very good feature if used correctly. Also keep
the locked in cache a measured percentage of the overall memory. I have seen
systems freeze up completely because of large locked caches.

Regards,
Nikhils

On Mon, Apr 13, 2009 at 11:20 PM, Matt Ingenthron <[email protected]> wrote:

>
> Qiangning Hong wrote:
>
>> The manpage says:
>>       -k     Lock down all paged memory. This is a somewhat
>> dangerous  option
>>              with  large caches, so consult the README and memcached
>> homepage
>>              for configuration suggestions.
>>
>> README says:
>> Also, be warned that the -k (mlockall) option to memcached might be
>> dangerous when using a large cache.  Just make sure the memcached
>> machines
>> don't swap.  memcached does non-blocking network I/O, but not disk.
>> (it
>> should never go to disk, or you've lost the whole point of it)
>>
>> Why locking pages in memory considered dangerous?  It can avoid
>> swapping, so that keep a good response time.  Doesn't it a good
>> feature?
>>
>>
>
> It's likely considered dangerous due to the impact it can have on other
> applications running on the same system, or components of the OS.  As you
> say, it is a good feature if used correctly.
> If you have, for instance, your application running on the same system and
> have a peak in user requests, it can lead to a situation where that
> application has memory needs and cannot get any more memory.  Even though
> your cache could have a low response time, the overall user experience can
> be quite low.
>
> I've recommended this flag to others in the past, and I'd just recommend
> start conservative (without creating too large a cache), monitor the
> environment, and tune from there.
>
> Hope that helps,
>
> - Matt
>

Reply via email to