bucket randomisation for storeMaintainSwapSpace()

From: Mark Treacy <mark@dont-contact.us>
Date: Tue, 25 Mar 1997 22:25:50 +1100

Back around 1.1.6 a change was introduced to randomise the order
of processing for storeMaintainSwapSpace(). I assume that the
reason for adding this randomisation was to overcome the problem
whereby an unstable squid would never scan the entire cache. (say squid
core dumped every 12 hours, the last half of the buckets would not get
scanned). I would think randomising the starting point for the scan
would have been sufficient, randomising the entire sequence seems
reasonable too.

I don't understand the reason for rerandomising the sequence after a
full scan. qsort()ing 65k random numbers is relatively time consuming
on any box (on an ultra 170 .75 seconds. On an alpha >.25 seconds), and
you don't really want that sort of delay whilst in production mode if
not necessary.

I'd suggest the following change be applied, but if there's a reason
for the re randomisation of the processing sequence, I'd be interested
to hear.

 - Mark.

*** /tmp/T0a001.w Tue Mar 25 22:07:27 1997
--- store.c Tue Mar 25 22:06:01 1997
***************
*** 2564,2570 ****
--- 2564,2572 ----
                  scan_revolutions++;
                  debug(51, 1, "Completed %d full expiration scans of store table\n",
                      scan_revolutions);
+ #ifdef notdef
                  storeRandomizeBuckets();
+ #endif
              }
              b = MaintBucketsOrder + bucket_index++;
              next = hash_get_bucket(store_table, b->bucket);
Received on Tue Jul 29 2003 - 13:15:40 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:15 MST