Testing Varnish

Mark Nottingham mnot at yahoo-inc.com
Wed Sep 20 23:14:34 CEST 2006

On 2006/09/20, at 1:35 PM, Poul-Henning Kamp wrote:

> In message <11A48748-CDA5-4185-9ECB-A6248A7351C3 at yahoo-inc.com>,  
> Mark Nottingham writes:
>> The bad news - testing for HTTP conformance with Co-Advisor <http://
>> coad.measurement-factory.com/> finds a *lot* of violations. However,
>> I'm just testing stock Varnish with no configuration (as that's not
>> documented! ;). Can anyone comment on the state of Varnish's HTTP
>> conformance?
> Have you tested Varnish as a proxy or as an origin server ?

As a gateway.

> Varnish is not a proxy in the RFC2616 sense.  Varnish
> is an origin server.  An origin server which gets its contents
> using HTTP, but an origin server nontheless.

That's a gateway, a.k.a. surrogate, a.k.a. reverse proxy. While it's  
true that many of the requirements for HTTP proxies won't apply to  
it, there are many HTTP requirements that do.

For example, Varnish is acting as a cache, and appears to violate  
many of the requirements for caches.

> RFC2616 only defines proxies and caches in a client side context
> and Varnish is (firmly!) a server-side facility.

No. From RFC2616:

>    cache
>       A program's local store of response messages and the subsystem
>       that controls its message storage, retrieval, and deletion. A
>       cache stores cacheable responses in order to reduce the response
>       time and network bandwidth consumption on future, equivalent
>       requests. Any client or server may include a cache, though a  
> cache
>       cannot be used by a server that is acting as a tunnel.

> To the extent that we fail origin server requirements that affect
> practical deployment of Varnish, we will fix, but I cannot guarantee
> that we will strive for "to-the-letter-and-damn-the-cost" compliance.

That's fine by me; perfect conformance is very difficult to obtain,  
and in many cases, not too useful when faced with real loads. My  
concerns are mostly around interoperability with other devices, and  
controlling how Varnish caches things.


Mark Nottingham
mnot at yahoo-inc.com

More information about the varnish-dev mailing list