Why are items limited to 1 megabyte in size?
Ahh, this is a popular question! Short answer: Because of how the memory allocator’s algorithm works. Long answer: Memcached’s memory storage engine (which will be pluggable/adjusted in the future…), uses a slabs approach to memory management. Memory is broken up into slabs chunks of varying sizes, starting at a minimum number and ascending by a factorial up to the largest possible value. Say the minimum value is 400 bytes, and the maximum value is 1 megabyte, and the factorial is 1.20: slab 1 – 400 bytes slab 2 – 480 bytes slab 3 – 576 bytes … etc. The larger the slab, the more of a gap there is between it and the previous slab. So the larger the maximum value the less efficient the memory storage is. Memcached also has to pre-allocate some memory for every slab that exists, so setting a smaller factorial with a larger max value will require even more overhead. There’re other reason why you wouldn’t want to do that… If we’re talking about a web page and you’re attempting to stor
Related Questions
- Another dive shop is having a sale, they say it is limited to in-stock items purchased at full retail while supplies last . . . what does this mean?
- Does someone who is reviewing a producing manager under the limited size and resources exception have to be a principal?
- Why are items limited to 1 megabyte in size?