what is the difference between slab, page and chunk in memcached
? If we set -m 128
, then how many slab, page, chunk we have? What is the benefit of slab?
Asked
Active
Viewed 1,340 times
2

Majid Azimi
- 547
- 1
- 13
- 29
1 Answers
2
This page provides good explanation of memcached terms. The basic relation among them is this: a slab has many pages which has many chunks. Here, I am quoting the following paragraph:
When you ask memcached to store a value, it looks up the “slab” associated with that value. A slab holds values within a particular size range. Slabs are composed of 1MB pages, which are broken into chunks of the slab’s size. Let’s say your value is 1001 bytes; memcached will look up the slab which holds values between 1000 and 2000 bytes. It then finds a page with an empty chunk and inserts the value into that chunk. Note that a chunk is fixed in size – it must be 2000 bytes in order to store the largest value for the slab.

Khaled
- 36,533
- 8
- 72
- 99