Re: squid-2.HEAD: storeCleanup and -F option (foreground rebuild)

From: Adrian Chadd <adrian_at_squid-cache.org>
Date: Sat, 13 Sep 2008 12:32:04 +0800

I've committed a slightly modified version of this - store_rebuild.c
r1.80 . Take a look and see if it works for you.

Thanks!

Adrian

2008/8/5 Alexander V. Lukyanov <lav_at_netis.ru>:
> Hello!
>
> I use squid in transparent mode, so I don't want degraded performance
> while rebuilding and cleanup. Here is a patch I use to make storeCleanup
> do all the work at once before squid starts processing requests, when
> -F option is specified on command line.
>
> Index: store_rebuild.c
> ===================================================================
> RCS file: /squid/squid/src/store_rebuild.c,v
> retrieving revision 1.80
> diff -u -p -r1.80 store_rebuild.c
> --- store_rebuild.c 1 Sep 2007 23:09:32 -0000 1.80
> +++ store_rebuild.c 5 Aug 2008 05:51:43 -0000
> @@ -68,7 +68,8 @@ storeCleanup(void *datanotused)
> hash_link *link_ptr = NULL;
> hash_link *link_next = NULL;
> validnum_start = validnum;
> - while (validnum - validnum_start < 500) {
> + int limit = opt_foreground_rebuild ? 1 << 30 : 500;
> + while (validnum - validnum_start < limit) {
> if (++bucketnum >= store_hash_buckets) {
> debug(20, 1) (" Completed Validation Procedure\n");
> debug(20, 1) (" Validated %d Entries\n", validnum);
> @@ -147,8 +148,8 @@ storeRebuildComplete(struct _store_rebui
> debug(20, 1) (" Took %3.1f seconds (%6.1f objects/sec).\n", dt,
> (double) counts.objcount / (dt > 0.0 ? dt : 1.0));
> debug(20, 1) ("Beginning Validation Procedure\n");
> - eventAdd("storeCleanup", storeCleanup, NULL, 0.0, 1);
> safe_free(RebuildProgress);
> + storeCleanup(0);
> }
>
> /*
>
>
Received on Sat Sep 13 2008 - 04:32:12 MDT

This archive was generated by hypermail 2.2.0 : Sat Sep 13 2008 - 12:00:05 MDT