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

From: Adrian Chadd <adrian_at_freebsd.org>
Date: Tue, 5 Aug 2008 14:25:34 +0800

Hm, so whats the behaviour without this patch?

I thought -F was meant to rebuild everything before Squid began
listening for requests..

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 Tue Aug 05 2008 - 06:52:28 MDT

This archive was generated by hypermail 2.2.0 : Thu Aug 07 2008 - 12:00:04 MDT