]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
From: Stewart Forster <slf@connect.com.au>
authorwessels <>
Mon, 17 Aug 1998 23:17:45 +0000 (23:17 +0000)
committerwessels <>
Mon, 17 Aug 1998 23:17:45 +0000 (23:17 +0000)
        Just recently our caches ran into troubles because the base squid 1.2
code doesn't delete objects fast enough under high load.  The old code
would only remove at most 50 objects per second.  When pulling in more
than that (as we often do) the disks start to fill and the disk selection
algorithm defaults to sending everything to the first specified cache_dir
once the disks fill.  Further, doing 50 deletes at once is also taxing on
the ASYNC threads.

        The patch applied makes more continous deletions of objects by
deleting objects every 1/10th second, and then speeding this up to as fast
as squid can go at more objects per second if our disks start to fill up
past the high water mark.

src/store.cc

index fe0aecb74b86e0232dda563e4adb838f8ab0bdba..798f6455f4579792eb1026b861fea037e55c5613 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.441 1998/08/17 16:50:39 wessels Exp $
+ * $Id: store.cc,v 1.442 1998/08/17 17:17:45 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager
  * AUTHOR: Harvest Derived
@@ -441,8 +441,8 @@ storeCheckCachable(StoreEntry * e)
     } else if (EBIT_TEST(e->flag, KEY_PRIVATE)) {
        debug(20, 3) ("storeCheckCachable: NO: private key\n");
     } else if (storeExpiredReferenceAge() < 300) {
-       debug(20,2)("storeCheckCachable: NO: LRU Age = %d\n",
-               storeExpiredReferenceAge());
+       debug(20, 2) ("storeCheckCachable: NO: LRU Age = %d\n",
+           storeExpiredReferenceAge());
     } else {
        return 1;
     }
@@ -589,16 +589,18 @@ storeMaintainSwapSpace(void *datanotused)
     int max_scan;
     int max_remove;
     static time_t last_warn_time = 0;
-    eventAdd("storeMaintainSwapSpace", storeMaintainSwapSpace, NULL, 1.0, 1);
     /* We can't delete objects while rebuilding swap */
-    if (store_rebuilding)
+    if (store_rebuilding) {
+       eventAdd("MaintainSwapSpace", storeMaintainSwapSpace, NULL, 1.0, 1);
        return;
-    if (store_swap_size < store_swap_high) {
-       max_scan = 100;
-       max_remove = 10;
+    } else if (store_swap_size < store_swap_high) {
+       max_scan = 200;
+       max_remove = 8;
+       eventAdd("MaintainSwapSpace", storeMaintainSwapSpace, NULL, 0.1, 1);
     } else {
        max_scan = 500;
-       max_remove = 50;
+       max_remove = 32;
+       eventAdd("MaintainSwapSpace", storeMaintainSwapSpace, NULL, 0.0, 1);
     }
     debug(20, 3) ("storeMaintainSwapSpace\n");
     for (m = store_list.tail; m; m = prev) {