memcached
avoids the exchange of two mechanisms:
Informing system administrators that machines should never switch. This allows administrators to probably not configure the swap space for the machine (it seems like a bad idea) or adjust the memory limits of running applications to ensure that nothing happens in swap. (Not only memcached
, but all applications.)
The mlockall(2)
system call can be used ( -k
) to ensure that all process memory is always locked in memory. This is mediated using the setrlimit(2)
RLIMIT_MEMLOCK
, so administrators will need to modify, for example. /etc/security/limits.conf
so that the memcached
user account blocks a lot more memory than usual. (Locked memory is indirect to prevent unreliable user accounts from starving the rest of the free memory system.)
Both of these steps are true if the point on the machine should be memcached
and possibly quite a bit. This is often a fair assumption, as larger deployments will devote to several (or many) memcached
machines.
source share