Issue 319 in memcached: Inconsistent display of maxbytes in "stats" and "stats settings"

38 views
Skip to first unread message

memc...@googlecode.com

unread,
May 6, 2013, 5:41:17 AM5/6/13
to memc...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 319 by the.6th....@gmail.com: Inconsistent display of maxbytes
in "stats" and "stats settings"
http://code.google.com/p/memcached/issues/detail?id=319

What steps will reproduce the problem?
1.echo "stats settings" | nc {host name or ip} {port}
2.echo "stats" | nc {host name or ip} {port}

What is the expected output? What do you see instead?
the limit_maxbytes in 'stats' is different from maxbytes in 'stats setting'
when the maxbytes is set beyond the range of unsigned int.

What version of the product are you using? On what operating system?
1.4.15 on any linux 64bits os

Please provide any additional information below.
I just look at the source code, the code to produce the output of 'stats'
is as below:
APPEND_STAT("limit_maxbytes", "%llu", (unsigned long
long)settings.maxbytes);
while the code for 'stats setting' is as:
APPEND_STAT("maxbytes", "%u", (unsigned int)settings.maxbytes);
so it seems that the upper 32bits are truncated during the conversion from
unsigned int to unsigned long long

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

memc...@googlecode.com

unread,
Aug 27, 2013, 10:00:36 PM8/27/13
to memc...@googlegroups.com

Comment #1 on issue 319 by hiranth...@gmail.com: Inconsistent display of
maxbytes in "stats" and "stats settings"
http://code.google.com/p/memcached/issues/detail?id=319

Hi,

Trouble here too. Eviction happens when it reaches the maxbytes not at the
limit_maxbytes. It only takes the maxbytes value not the limit_maxbytes
value.

# rpm -qa | grep memcached
memcached-1.4.15-1.el6.x86_64
# file /usr/bin/memcached
/usr/bin/memcached: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
]# uname -rop
2.6.32-358.11.1.el6.x86_64 x86_64 GNU/Linux
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.4 (Santiago)
# cat /etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="2048"
CACHESIZE="7168"
OPTIONS=""
# echo "stats settings" | nc localhost 11211 | grep maxbytes
STAT maxbytes 3221225472
]# echo "stats" | nc localhost 11211 | grep limit_maxbytes
STAT limit_maxbytes 7516192768

This is in production and we are in a trouble. Please help

Regards
Hirantha

memc...@googlecode.com

unread,
Dec 7, 2013, 3:33:58 AM12/7/13
to memc...@googlegroups.com
Updates:
Status: Fixed

Comment #2 on issue 319 by dorma...@rydia.net: Inconsistent display of
maxbytes in "stats" and "stats settings"
http://code.google.com/p/memcached/issues/detail?id=319

To the first guy:

Just pushed a fix, will be in the next release.

To the second guy:

I hope you figured out what the problem was, because it certainly wasn't
that. You didn't print out any of the stats saying what your stored bytes
were, and 'maxbytes' is the same internal value for both maxbytes and
limit_maxbytes, it's just the display that was broken.
Reply all
Reply to author
Forward
0 new messages