Hiya,
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.
RECOMMEND: Never set cache_swap_high greater than 99%.
The following patch is applied against squid 1.2beta23 PL 4 base.
--- store.c 1998/08/15 23:56:33 1.1
+++ store.c 1998/08/16 08:48:07
@@ -586,16 +586,19 @@
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("storeMaintainSwapSpace", storeMaintainSwapSpace, NULL,1.0,1);
return;
+ }
if (store_swap_size < store_swap_high) {
- max_scan = 100;
- max_remove = 10;
+ max_scan = 200;
+ max_remove = 8;
+ eventAdd("storeMaintainSwapSpace", storeMaintainSwapSpace, NULL,0.1,1);
} else {
max_scan = 500;
- max_remove = 50;
+ max_remove = 32;
+ eventAdd("storeMaintainSwapSpace", storeMaintainSwapSpace, NULL,0.0,1);
}
debug(20, 3) ("storeMaintainSwapSpace\n");
for (m = store_list.tail; m; m = prev) {
Received on Tue Jul 29 2003 - 13:15:51 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:51 MST