diff options
author | Colin Pitrat <colin.pitrat@amadeus.com> | 2009-10-29 18:39:42 -0700 |
---|---|---|
committer | Dustin Sallings <dustin@spy.net> | 2009-10-30 16:18:53 -0700 |
commit | 780a257b007e34423f0e87f40d45133fdd7e7e1f (patch) | |
tree | e1c783df2f1b284f976b89c79b7bb6ade7efa8b7 | |
parent | 95c8220d6900d95a84ee4033ac4ff75265fe7979 (diff) | |
download | memcached-780a257b007e34423f0e87f40d45133fdd7e7e1f.tar.gz |
Use slab class growth factor for slab size limit
Re Colin:
"When using a growth factor smaller than 2.0, the normal growth stops once
the chunk size reach half the page size (1 MB by default)."
This adds two more slab classes by default, but makes memcached a little
more efficient for larger values. This will create a *lot* more slabs if
you are increasing the page limit via -I
However, if you're lowering the memory limit, this helps keep things
efficient.
-Dormando
-rw-r--r-- | slabs.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -116,7 +116,7 @@ void slabs_init(const size_t limit, const double factor, const bool prealloc) { memset(slabclass, 0, sizeof(slabclass)); - while (++i < POWER_LARGEST && size <= settings.item_size_max / 2) { + while (++i < POWER_LARGEST && size <= settings.item_size_max / factor) { /* Make sure items are always n-byte aligned */ if (size % CHUNK_ALIGN_BYTES) size += CHUNK_ALIGN_BYTES - (size % CHUNK_ALIGN_BYTES); |