]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
changed no-caching based on http service time to be based on number
authorwessels <>
Thu, 10 Sep 1998 02:05:47 +0000 (02:05 +0000)
committerwessels <>
Thu, 10 Sep 1998 02:05:47 +0000 (02:05 +0000)
of disk files open.

src/cf.data.pre
src/fd.cc
src/globals.h
src/stat.cc
src/store.cc
src/structs.h

index c2a059469a26cea46c9f380f474aa3e9df7f8335..dc2c1c316981429066efb5e51517ce6ff21c671c 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.106 1998/09/09 18:21:50 wessels Exp $
+# $Id: cf.data.pre,v 1.107 1998/09/09 20:05:47 wessels Exp $
 #
 #
 # SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -2579,4 +2579,10 @@ min_icp_poll_cnt 8
 min_http_poll_cnt 8
 DOC_END
 
+NAME: max_open_disk_fds
+TYPE: int
+LOC: Config.max_open_disk_fds
+DEFAULT: 0
+DOC_NONE
+
 EOF
index 68c5daf7e62d0e5d06ba0ad614119fa84e78a22b..a1088d2ad48a93c2c928353fc06eabbe5aeb7b6f 100644 (file)
--- a/src/fd.cc
+++ b/src/fd.cc
@@ -1,6 +1,6 @@
 
 /*
- * $Id: fd.cc,v 1.26 1998/07/22 20:37:18 wessels Exp $
+ * $Id: fd.cc,v 1.27 1998/09/09 20:05:49 wessels Exp $
  *
  * DEBUG: section 51    Filedescriptor Functions
  * AUTHOR: Duane Wessels
@@ -77,6 +77,8 @@ fd_close(int fd)
     debug(51, 3) ("fd_close FD %d %s\n", fd, F->desc);
     fdUpdateBiggest(fd, F->open = FD_CLOSE);
     Number_FD--;
+    if (F->type == FD_FILE)
+       open_disk_fd--;
     memset(F, '\0', sizeof(fde));
     F->timeout = 0;
 }
@@ -97,6 +99,8 @@ fd_open(int fd, unsigned int type, const char *desc)
     if (desc)
        xstrncpy(F->desc, desc, FD_DESC_SZ);
     Number_FD++;
+    if (type == FD_FILE)
+       open_disk_fd++;
 }
 
 void
index ffb87de9aecdd646e7857021e7f2a0202109b83f..898c18629434e8ef9101ad688ccff761ef0279d8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: globals.h,v 1.66 1998/08/21 04:03:47 wessels Exp $
+ * $Id: globals.h,v 1.67 1998/09/09 20:05:49 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -142,3 +142,4 @@ extern time_t delay_pools_last_update;      /* 0 */
 extern int refresh_nocache_hack;       /* 0 */
 #endif
 extern request_flags null_request_flags;
+extern int open_disk_fd;               /* 0 */
index 935507a822d60c43f0066f379aa12054449a4270..268375e3021aafafe2c10c6b1be9615380676dde 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.284 1998/09/04 23:05:02 wessels Exp $
+ * $Id: stat.cc,v 1.285 1998/09/09 20:05:50 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -572,6 +572,8 @@ info_get(StoreEntry * sentry)
        Squid_MaxFD - Number_FD);
     storeAppendPrintf(sentry, "\tReserved number of file descriptors:  %4d\n",
        RESERVED_FD);
+    storeAppendPrintf(sentry, "\tDisk files open:                      %4d\n",
+       open_disk_fd);
 
     storeAppendPrintf(sentry, "Internal Data Structures:\n");
     storeAppendPrintf(sentry, "\t%6d StoreEntries\n",
index 0720f88ebddda6ec193e760b859b9d636228881e..62a1bebb8996517d13014b666d18fb117952c5a2 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.454 1998/09/09 16:47:08 wessels Exp $
+ * $Id: store.cc,v 1.455 1998/09/09 20:05:52 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager
  * AUTHOR: Harvest Derived
@@ -456,7 +456,7 @@ struct _store_check_cachable_hist {
        int negative_cached;
        int too_big;
        int private_key;
-       int http_median_too_high;
+       int too_many_open_files;
        int lru_age_too_low;
     } no;
     struct {
@@ -492,12 +492,9 @@ storeCheckCachable(StoreEntry * e)
     } else if (EBIT_TEST(e->flag, KEY_PRIVATE)) {
        debug(20, 3) ("storeCheckCachable: NO: private key\n");
        store_check_cachable_hist.no.private_key++;
-#if WIP
-    } else if (statMedianSvc(5, MEDIAN_HTTP) > 2000.0) {
-       debug(20, 2) ("storeCheckCachable: NO: median HTTP svc time = %d\n",
-           statMedianSvc(5, MEDIAN_HTTP));
-       store_check_cachable_hist.no.http_median_too_high++;
-#endif
+    } else if (Config.max_open_disk_fds && open_disk_fd > Config.max_open_disk_fds) {
+       debug(20, 2) ("storeCheckCachable: NO: too many disk files open\n");
+       store_check_cachable_hist.no.too_many_open_files++;
     } else if (storeExpiredReferenceAge() < 300) {
        debug(20, 2) ("storeCheckCachable: NO: LRU Age = %d\n",
            storeExpiredReferenceAge());
@@ -528,8 +525,8 @@ storeCheckCachableStats(StoreEntry * sentry)
        store_check_cachable_hist.no.too_big);
     storeAppendPrintf(sentry, "no.private_key\t%d\n",
        store_check_cachable_hist.no.private_key);
-    storeAppendPrintf(sentry, "no.http_median_too_high\t%d\n",
-       store_check_cachable_hist.no.http_median_too_high);
+    storeAppendPrintf(sentry, "no.too_many_open_files\t%d\n",
+       store_check_cachable_hist.no.too_many_open_files);
     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",
index 9aaba6d3a3597fc7e5fb523c206029eb535463ca..6f6f5ac689a4eaf5193cc64ec82c698f2d81f48f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.218 1998/09/09 18:18:05 wessels Exp $
+ * $Id: structs.h,v 1.219 1998/09/09 20:05:54 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -430,6 +430,7 @@ struct _SquidConfig {
        int icp_min_poll;
        int http_min_poll;
     } comm_incoming;
+    int max_open_disk_fds;
 };
 
 struct _SquidConfig2 {