summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Sallings <dustin@spy.net>2009-03-29 10:35:58 -0700
committerDustin Sallings <dustin@spy.net>2009-03-29 10:35:58 -0700
commitb8d997e532ffbb562d01f82bc19e09dd5f106195 (patch)
treec1468fe51298f4bdf8adb9b7a572bb425b2fafcb
parent91adade7077902f43cbed1ea5483c0f49a59603d (diff)
downloadmemcached-b8d997e532ffbb562d01f82bc19e09dd5f106195.tar.gz
Define TAIL_REPAIR_TIME as a constant.
-rw-r--r--items.c2
-rw-r--r--memcached.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/items.c b/items.c
index 1e89f50..6f18759 100644
--- a/items.c
+++ b/items.c
@@ -179,7 +179,7 @@ item *do_item_alloc(char *key, const size_t nkey, const int flags, const rel_tim
*/
tries = 50;
for (search = tails[id]; tries > 0 && search != NULL; tries--, search=search->prev) {
- if (search->refcount != 0 && search->time + 10800 < current_time) {
+ if (search->refcount != 0 && search->time + TAIL_REPAIR_TIME < current_time) {
itemstats[id].tailrepairs++;
search->refcount = 0;
do_item_unlink(search);
diff --git a/memcached.h b/memcached.h
index 49e462b..2692ca1 100644
--- a/memcached.h
+++ b/memcached.h
@@ -63,6 +63,10 @@
#define DONT_PREALLOC_SLABS
#define MAX_NUMBER_OF_SLAB_CLASSES (POWER_LARGEST + 1)
+/* How long an object can reasonably be assumed to be locked before
+ harvesting it on a low memory condition. */
+#define TAIL_REPAIR_TIME (3 * 3600)
+
/** Time relative to server start. Smaller than time_t on 64-bit systems. */
typedef unsigned int rel_time_t;