summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;