> Well, the problem is that memcached will use swap, when it runs out of > resident memory. When swap space fills up, memcached will crash under > load. > > Yesterday, I had the -m option set to 3700 (or 3700 megabtyes), since > I have a 4GB system. But, I started getting evictions when the > dataset reached the size of 3219.9 megabytes. As I mentioned above, I > started getting evictions at 3763 megabytes of RSS and 3834 megabytes > of VSZ. Is the -m option the size of the dataset or is it the size of > resident memory? > > Today, I increased the -m option to 8000 (or 8000 megabytes) to see > what would happen. I only have 3954 megabytes total memory in the > system. Now, memcached is filling up the swap space. I assume that I > will start getting evictions when the virtual memory is full. > > It seems to me that I should avoid touching the swap space, since > memcached can become unstable when using swap space. But, last week, > I got into trouble because I set the -m option close to the total > available memory on the system, and I guess that I had the value set > too high, since the swap space filled up and memcached crashed. > Today, I am trying to duplicate the issue that I saw last week.
-m is the limit of the internal slabber. your stored data will be some amount smaller than that due to overhead. As is stated in a lot of places, there're a few hundred megs of extra things going on, -m isn't a global limit. You seem to have confused virtual memory and resident initially; the virtual memory doesn't matter at all. just keep reducing -m until your system is happy.
