[ANN] x0 HTTP server and framework (initial release)

Marc Lehmann schmorp at schmorp.de
Sat Apr 3 21:14:32 CEST 2010

On Sat, Apr 03, 2010 at 12:51:02PM +0200, Christian Parpart <trapni at gentoo.org> wrote:
> However, I got told that my current sendfile() use is not ideal, as it is 
> indeed nonblocking for the target fd but the source fd (on-disk file)
> it still may block. Which is something I have to work around

Apart from the mmap/madvise/mincore/write method (where mmap is blocking
and madvise often is), there is also the readahead (e.g. via eio) and
sendfile "method".

Note that none of those guarantee that the buffers are still there - ignoring
virtual memory, the only way to guarantee responsiveness under pressure is to
do the old-fashioned read/write.

I wonder what happened if one used a threadpool for sendfile, for large
files only?

(there certainly is eio_sendfile to make it easy to try it out :)

                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\

More information about the libev mailing list