diff options
author | dormando <dormando@rydia.net> | 2017-06-27 12:17:59 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2019-09-17 02:37:15 -0700 |
commit | b5ea90160579ba060b8e1d269595b3ec5d77d740 (patch) | |
tree | 96d5dc43912f32b4d48d6a19cf161052e9aaa137 /slabs.h | |
parent | 554b56687a19300a75ec24184746b5512580c819 (diff) | |
download | memcached-b5ea90160579ba060b8e1d269595b3ec5d77d740.tar.gz |
restartable cache
"-e /path/to/tmpfsmnt/file"
SIGUSR1 for graceful stop
restart requires the same memory limit, slab sizes, and some other
infrequently changed details. Most other options and features can
change between restarts. Binary can be upgraded between restarts.
Restart does some fixup work on start for every item in cache. Can take
over a minute with more than a few hundred million items in cache.
Keep in mind when a cache is down it may be missing invalidations,
updates, and so on.
Diffstat (limited to 'slabs.h')
-rw-r--r-- | slabs.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -8,7 +8,7 @@ 3rd argument specifies if the slab allocator should allocate all memory up front (if true), or allocate memory in chunks as it is needed (if false) */ -void slabs_init(const size_t limit, const double factor, const bool prealloc, const uint32_t *slab_sizes); +void slabs_init(const size_t limit, const double factor, const bool prealloc, const uint32_t *slab_sizes, void *mem_base_external, bool reuse_mem); /** Call only during init. Pre-allocates all available memory */ void slabs_prefill_global(void); @@ -19,6 +19,7 @@ void slabs_prefill_global(void); */ unsigned int slabs_clsid(const size_t size); +unsigned int slabs_size(const int clsid); /** Allocate object of given length. 0 on error */ /*@null@*/ #define SLABS_ALLOC_NO_NEWPAGE 1 @@ -65,4 +66,7 @@ void slabs_rebalancer_resume(void); void slabs_set_storage(void *arg); #endif +/* Fixup for restartable code. */ +unsigned int slabs_fixup(char *chunk, const int border); + #endif |