From 9daa51edaab44c02ce0917ff94b20683036d7594 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Thu, 26 Jan 2017 22:03:10 -0500 Subject: [PATCH] bees: limit FD cache size explicitly This will allow the default size limit for cache objects to be changed with impunity. Signed-off-by: Zygo Blaxell --- src/bees-context.cc | 1 + src/bees.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/bees-context.cc b/src/bees-context.cc index 7b48054..7fa176e 100644 --- a/src/bees-context.cc +++ b/src/bees-context.cc @@ -36,6 +36,7 @@ BeesFdCache::BeesFdCache() BEESCOUNTADD(open_ino_ms, open_timer.age() * 1000); return rv; }); + m_file_cache.max_size(BEES_FD_CACHE_SIZE); } Fd diff --git a/src/bees.h b/src/bees.h index f34e784..bba158a 100644 --- a/src/bees.h +++ b/src/bees.h @@ -81,6 +81,9 @@ const int BEES_PROGRESS_INTERVAL = 3600; // Status is output every freakin second. Use a ramdisk. const int BEES_STATUS_INTERVAL = 1; +// Number of FDs to open (not counting 100 roots) +const size_t BEES_FD_CACHE_SIZE = 384; + // Log warnings when an operation takes too long const double BEES_TOO_LONG = 2.5;