From: wessels <> Date: Sat, 21 Nov 1998 09:13:30 +0000 (+0000) Subject: don't swap out a file if we are under the RESERVED_FD limit X-Git-Tag: SQUID_3_0_PRE1~2503 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=59ffcdf87550f830a8f1f4447fc7cffaca43aa2d;p=thirdparty%2Fsquid.git don't swap out a file if we are under the RESERVED_FD limit --- diff --git a/src/store.cc b/src/store.cc index f0f2a374f1..34003333bc 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.472 1998/11/13 22:06:36 rousskov Exp $ + * $Id: store.cc,v 1.473 1998/11/21 02:13:30 wessels Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -465,6 +465,7 @@ struct _store_check_cachable_hist { int too_big; int private_key; int too_many_open_files; + int too_many_open_fds; int lru_age_too_low; } no; struct { @@ -513,6 +514,9 @@ storeCheckCachable(StoreEntry * e) } else if (storeTooManyDiskFilesOpen()) { debug(20, 2) ("storeCheckCachable: NO: too many disk files open\n"); store_check_cachable_hist.no.too_many_open_files++; + } else if (fdNFree() < RESERVED_FD) { + debug(20, 2) ("storeCheckCachable: NO: too FD's open\n"); + store_check_cachable_hist.no.too_many_open_fds++; } else if (storeExpiredReferenceAge() < 300) { debug(20, 2) ("storeCheckCachable: NO: LRU Age = %d\n", storeExpiredReferenceAge()); @@ -547,6 +551,8 @@ storeCheckCachableStats(StoreEntry * sentry) store_check_cachable_hist.no.private_key); storeAppendPrintf(sentry, "no.too_many_open_files\t%d\n", store_check_cachable_hist.no.too_many_open_files); + storeAppendPrintf(sentry, "no.too_many_open_fds\t%d\n", + store_check_cachable_hist.no.too_many_open_fds); storeAppendPrintf(sentry, "no.lru_age_too_low\t%d\n", store_check_cachable_hist.no.lru_age_too_low); storeAppendPrintf(sentry, "yes.default\t%d\n",