sendfilev vs writev

Nils Goroll slink at
Wed Mar 4 19:50:41 CET 2009

Hi Dag,

> 3) Experience has shown that even when it works, sendfile() does not
>    provide any significant performance improvement unless your working
>    set consists mostly of large (multi-megabyte) objects.

Which wouldn't surprise me as (at least on Solaris) sendfilev and writev both do 
scatter-gather writes when used on memory buffers. My understanding is that 
sendfilev would only be advantageous if Varnish actually read from file 
descriptors rather than from cache buffers.

IMHO, (at least on Solaris) only the cache_pipe code would benefit from 
sendfile[v], as at first sight that piece of code seems to loop over read/write.


More information about the varnish-dev mailing list