Re: Mapping VCL variables to internal variables

2008-05-22 Thread Poul-Henning Kamp
In message <[EMAIL PROTECTED]>, Charles Curley writes:

>I'd like to set a variable in VCL, and then use it in a modification
>of Varnish. Having added to req.hash with something like:
>
>sub vcl_hash
>{
>if (req.http.Accept-Encoding ~ "gzip") {
>set req.hash +=3D "gzip";
>} else if (req.http.Accept-Encoding ~ "deflate") {
>set req.hash +=3D "deflate";
>}
>}
>
>where do I find that in Varnish itself?

See cache_center.c::cnt_lookup() [search for "VCL_hash_method(sp);"],
and cache_hash.c::HSH_Copy(), HSH_Compare() and HSH_Lookup().

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
varnish-dev mailing list
varnish-dev@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-dev


Re: sendfile() in varnish

2008-05-22 Thread Poul-Henning Kamp
In message <[EMAIL PROTECTED]>, Yutaro Shimamura writ
es:

>value of varnishstat "Objects sent with sendfile" is almost 0.
>0 0.00 0.00 Objects sent with sendfile
>
>so, write() called.
> 37327571   335.20   157.86 Objects sent with write
>
>when do you use sendfile()?

By default: never, there are problems with all sendfile() implementations
that prevent them from being usable in Varnish.  Only FreeBSD-Current
and later FreeBSD-8 will support sendfile().

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
varnish-dev mailing list
varnish-dev@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-dev


Re: sendfile() in varnish

2008-05-22 Thread Per Buer
Yutaro Shimamura skrev:

> when do you use sendfile()?

Sendfile is not used on Linux or FreeBSD. If I recall correctly it's
because there is no sure way of knowing when the sendfile call is done
with the data.


Per.



signature.asc
Description: OpenPGP digital signature
___
varnish-dev mailing list
varnish-dev@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-dev


sendfile() in varnish

2008-05-22 Thread Yutaro Shimamura

Hello.

I using Varnish for Ajax based API server.
with
 -T 127.0.0.1:10411 \
 -f /var/home/yu/etc/000.vcl \
 -s file,/home/cache,16g \
 -p thread_pool_min=512 \
 -p thread_pool_max=3096 \
 -p thread_pools=16 \
 -p listen_depth=3096 \
 -p client_http11=on \
 -p backend_http11=on \
 -p cc_command="cc -fpic -shared -O3 -Wl,-x -o %o %s" \
 -p lru_interval=21600 \
 -P /var/run/varnishd.pid \
 -u www \
 -a 0.0.0.0:80

value of varnishstat "Objects sent with sendfile" is almost 0.
0 0.00 0.00 Objects sent with sendfile

so, write() called.
 37327571   335.20   157.86 Objects sent with write

when do you use sendfile()?

regards,

---
Yutaro Shimamura
[EMAIL PROTECTED]
___
varnish-dev mailing list
varnish-dev@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-dev