Varnish use for purely binary files

Poul-Henning Kamp phk at phk.freebsd.dk
Tue Jan 19 01:06:34 CET 2010


In message <02D0EC1A-D0B0-40EE-B278-B57714E54BAE at dynamine.net>, "Michael S. Fis
cher" writes:

>But we are not discussing serving dynamic content in this thread
>anyway.  We are talking about binary files, aren't we?  Yes?  Blobs
>on disk?  Unless everyone is living on a different plane then me,
>then I think that's what we're talking about.
>
>For those you should be using a general purpose webserver.  There's
>no reason you can't run both side by side.  And I stand by my
>original statement about their performance relative to Varnish.

Why would you use a general purpose webserver, if Varnish can
deliver 80 or 90% of your content much faster and much cheaper ?

It sounds to me like you have not done your homework with respect
to Varnish.

For your information, here is the approximate sequence of systemcalls
Varnish performs for a cache hit:

	read		(get the HTTP request)
	timestamp
	timestamp
	timestamp
	timestamp
	writev		(write the response)

With some frequency, depending on your system and OS, you will also
see a few mutex operations.

The difference between the first and the last timestamp is typically
on the order of 10-20 microseconds.  The middle to timestamps
are mostly for my pleasure and could be optimized out, if they
made any difference.

This is why people who run synthetic benchmarks do insane amounts
of req/s on varnish boxes, for values of insane >> 100.000.

I suggest you look at how many systems calls and how long time your
"general purpose webserver" spends doing the same job.

Once you have done that, I can recommend you read the various
architects notes I've written, and maybe browse through

	http://phk.freebsd.dk/pubs/varnish_perf.pdf

Where you decide to deposit your "conventional wisdom" afterwards
is for you to decide, but it is unlikely to be applicable.

Poul-Henning

-- 
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-misc mailing list