Memcached: bytes_written vs bytes
Please help me in understanding the concept of bytes_written, bytes and limit_maxbytes. When I do stats on my memcache server, I get limit_maxbytes as 1GB. If I have to figure out if memcache memory is getting full, which value should I look - bytes or bytes_written? In my case, bytes is always less than limit_maxbytes wher开发者_Go百科e as bytes_written sometimes exceeds way above limit_maxbytes (goes up to 16GB sometimes). Is that a thing to concern about?
Thanks in advance!
Regards, Ashish
I actually got here by search StackOverflow for an example answer to send to you on the memcached mailing list, but here we go. bytes_written
is just the total number of bytes sent over the network by the server, it has no bearing or connection on the total size of the data you're storing, and will usually be way bigger, especially on a server that's been up for days, weeks, months, years. See: memcached protocol documentation, search for bytes_written.
bytes
will give you some indication, but I wouldn't trust it as more than a rough yardstick. "Full" can also mean more than one thing: are you concerned that new items will evict old items? Are you concerned that memcached will start paging? Strictly speaking, for what memcached was designed for, you should really only be using evictions
to tell if you are evicting things (and even then, not really too worried, unless the number is huge), rather than guessing if you will run out of space from bytes
.
If you are looking for running out of "memory" issues, you need to watch for the number of evictions per "minute" or "second".
YOU WILL run out of memory, the question is how much churn in your memcache is acceptable.
You can also run memcached -vv to turn on logging, which will give you and idea of your churn rate. You have to watch for keys being added, but never accessed.
精彩评论