r3080 - trunk/varnish-cache/bin/varnishncsa

Poul-Henning Kamp phk at phk.freebsd.dk
Mon Aug 11 12:09:49 CEST 2008


In message <20080811100400.C23501EC11B at projects.linpro.no>, petter at projects.lin
pro.no writes:
>Author: petter
>Date: 2008-08-11 12:04:00 +0200 (Mon, 11 Aug 2008)
>New Revision: 3080
>
>Modified:
>   trunk/varnish-cache/bin/varnishncsa/varnishncsa.c
>Log:
>It now always flushes the stream, even for stdout. See ticket #182.

No, no, no and no.

This is an intolerable performance overhead.

Add an option to control if flushing should be done on all records
or not, but do not ny default waste performance needlessly.

>Modified: trunk/varnish-cache/bin/varnishncsa/varnishncsa.c
>===================================================================
>--- trunk/varnish-cache/bin/varnishncsa/varnishncsa.c	2008-08-11 09:49:41 UTC (rev 3079)
>+++ trunk/varnish-cache/bin/varnishncsa/varnishncsa.c	2008-08-11 10:04:00 UTC (rev 3080)
>@@ -452,9 +452,8 @@
> 		fprintf(fo, "\"%s\"\n",
> 		    lp->df_User_agent ? lp->df_User_agent : "-");
> 
>-		/* hack: flush after every line if writing to file */
>-		if (fo != stdout)
>-			fflush(fo);
>+		/* flush the stream */
>+		fflush(fo);
> 	}
> 
> 	/* clean up */
>
>_______________________________________________
>varnish-commit mailing list
>varnish-commit at projects.linpro.no
>http://projects.linpro.no/mailman/listinfo/varnish-commit
>

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-commit mailing list