From: wessels <> Date: Mon, 17 Aug 1998 23:17:45 +0000 (+0000) Subject: From: Stewart Forster X-Git-Tag: SQUID_3_0_PRE1~2887 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c8b09b26b6f10e2e4a9bd3498ee31b82952d3888;p=thirdparty%2Fsquid.git From: Stewart Forster 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. --- diff --git a/src/store.cc b/src/store.cc index fe0aecb74b..798f6455f4 100644 --- a/src/store.cc +++ b/src/store.cc @@ -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) {