Mailing List Archive

Operation of varnish
In message <462488E9.8040402 at fer.hr>, Ivan Voras writes:

>Does varnish do full buffering from the server-side? I.e. when the
>client connects to varnish, and varnish connects to the "real" web
>server, does it buffer the web server response fully, and closes the web
>server side of the connection (thus freeing it for other uses), then
>pipes the data to the client at the rate client's network allows?

Depends what varnish (or rather: the VCL program) decides to do.

If "pipe" is chosen, Varnish just moves bytes forth and back.

In the "trunk" version of varnish, everything else is fully buffered.
In the released versions, up to 1.0.3, "pass" mode will not do full
buffing, but fetches to cache will.

>Can varnish generate HTTP logs in the "combined" format.

Pointer to documentation ?

>(subquestion:
>how about http/1.1 virtual hosts? can each get its own log?)

Right now: No.

>If I
>understand this correctly, varnish would generate its own logs, and then
>the apache could generate its own log, but apche's will show every=20
>connection as arriving from 127.0.0.1, right?

I'm not sure if Apache logs the tcp source address or the HTTP header
client IP# in the logs.

--
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.
Operation of varnish [ In reply to ]
Does varnish do full buffering from the server-side? I.e. when the
client connects to varnish, and varnish connects to the "real" web
server, does it buffer the web server response fully, and closes the web
server side of the connection (thus freeing it for other uses), then
pipes the data to the client at the rate client's network allows?

Can varnish generate HTTP logs in the "combined" format. (subquestion:
how about http/1.1 virtual hosts? can each get its own log?) If I
understand this correctly, varnish would generate its own logs, and then
the apache could generate its own log, but it will show every connection
as arriving from 127.0.0.1, right?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://projects.linpro.no/pipermail/varnish-misc/attachments/20070415/bf061dc6/attachment.pgp
Operation of varnish [ In reply to ]
Hi!

I'm thinking of trying out varnish, but I have several questions about
it's operation:

Does varnish do full buffering from the server-side? I.e. when the
client connects to varnish, and varnish connects to the "real" web
server, does it buffer the web server response fully, and closes the web
server side of the connection (thus freeing it for other uses), then
pipes the data to the client at the rate client's network allows?

Can varnish generate HTTP logs in the "combined" format. (subquestion:
how about http/1.1 virtual hosts? can each get its own log?) If I
understand this correctly, varnish would generate its own logs, and then
the apache could generate its own log, but apche's will show every
connection as arriving from 127.0.0.1, right?



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : http://projects.linpro.no/pipermail/varnish-misc/attachments/20070417/67f1336d/attachment.pgp
Operation of varnish [ In reply to ]
Poul-Henning Kamp wrote:

> If "pipe" is chosen, Varnish just moves bytes forth and back.
>
> In the "trunk" version of varnish, everything else is fully buffered.
> In the released versions, up to 1.0.3, "pass" mode will not do full
> buffing, but fetches to cache will.
>
>> Can varnish generate HTTP logs in the "combined" format.
>
> Pointer to documentation ?

From Apache's httpd.conf, it is defined as:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
combined

Documentation about the substitution codes and meaning is at:
http://httpd.apache.org/docs/2.2/logs.html

>> If I
>> understand this correctly, varnish would generate its own logs, and then
>> the apache could generate its own log, but apche's will show every=20
>> connection as arriving from 127.0.0.1, right?
>
> I'm not sure if Apache logs the tcp source address or the HTTP header
> client IP# in the logs.

You mean "Forwarded-For:" header?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : http://projects.linpro.no/pipermail/varnish-misc/attachments/20070419/8b4e6f07/attachment.pgp
Operation of varnish [ In reply to ]
Ivan Voras <ivoras at fer.hr> writes:
> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

This is exactly what varnishncsa outputs.

DES
--
Dag-Erling Sm?rgrav
Senior Software Developer
Linpro AS - www.linpro.no