Memory utilisation of memcached

4 views
Skip to first unread message

Harish Kumar

unread,
Jun 29, 2009, 2:30:24 AM6/29/09
to memcached
Hi,

I am a new user interested in knowing the details of memcached. I am
very confused seeing the code. Can any one tell in detail or give me a
link about the memory utilisation in memcached. I had gone through
slabs.c file but I didn't understand the concept. What is the smallest
chunk of memory used. By what power the memory chunk increases.
Anticipating for a good response from the professionals. Thanks in
advance.

Toru Maesaka

unread,
Jun 29, 2009, 3:45:57 AM6/29/09
to memc...@googlegroups.com
Hi!

The default growth factor used in memcached is 1.25 which you can
control with the '-f' option (take a look at the help menu with '-h').

The lower limit of a slab class is 88 bytes and the upper limit is 1MB.

The ideal growth factor depends on your use-case and if you're
interested in playing around with this, you can take a look at the
slab classes that memcached had created with 'stats slabs' (you could
either use telnet or use your client library's functionality to get
the figures).

It's probably best to take a step back and look at your application.
E.g. think what kind of data that you're going to cache and the sizes
of those data.

Other than that this may interest you (not exactly what you're after
but somewhat relevant):

http://torum.net/2008/12/more-memcached-space/

Cheers,
Toru

Martin MC Brown

unread,
Jun 29, 2009, 4:09:59 AM6/29/09
to memc...@googlegroups.com
Hi,

Try the description I put into the MySQL manual:

http://dev.mysql.com/doc/refman/5.1/en/ha-memcached-using-memory.html

MC


--
Martin MC Brown, Technical Writer
MySQL and Infrastructure Group, Sun Microsystems
http://sun.com | http://mysql.com
Phone: x18435/+44 247 669 8435 Skype: mcmcslp


steve.yen

unread,
Jun 30, 2009, 12:08:00 PM6/30/09
to memcached
Hi,
I also wrote some notes about the slabber for those trying to get a
sense of the code, and put them on the wiki...

http://code.google.com/p/memcached/wiki/MemcachedInternals

cheers,
Steve
> MySQL and Infrastructure Group, Sun Microsystemshttp://sun.com|http://mysql.com

Harish Kumar

unread,
Jul 1, 2009, 5:26:19 PM7/1/09
to memcached
Thank you for the discussion.
Can I know the details of flat_storage.c. The significance of that
file and its supported files. Well, this confuses me alot. Even I am
interested in finding a way to compile the code. Experts help needed.
Thank you in advance

Harish Kumar

unread,
Jul 5, 2009, 7:08:22 PM7/5/09
to memcached
Is there any one who can help me ?

Dustin

unread,
Jul 5, 2009, 7:20:38 PM7/5/09
to memcached

On Jul 1, 2:26 pm, Harish Kumar <abscond1...@yahoo.co.in> wrote:
> Thank you for the discussion.
> Can I know the details of flat_storage.c. The significance of that
> file and its supported files. Well, this confuses me alot. Even I am
> interested in finding a way to compile the code. Experts help needed.
> Thank you in advance

The memcached server does not and has never had a file within it
called flat_storage.c
Reply all
Reply to author
Forward
0 new messages