High performance IO (sendfile(), caching, and libev(ent))

2012-12-20 Thread Jean-Philippe Ouellet
Hello, I'm trying to learn about writing high performance servers, and I have a few questions not clearly answered by any documentation I can find. I'm comfortable with select(), poll(), and kqueue(), but that only goes so far. I'm currently looking into how to send static files (over a network)

Re: High performance IO (sendfile(), caching, and libev(ent))

2012-12-20 Thread Jean-Philippe Ouellet
On 12/20/12 3:53 AM, Jean-Philippe Ouellet wrote: and madvise() them to not be swapped out? Oops, I think I might have misinterpreted the meaning of MADV_WILLNEED. I think I meant mlock().

Re: High performance IO (sendfile(), caching, and libev(ent))

2012-12-20 Thread Otto Moerbeek
On Thu, Dec 20, 2012 at 04:06:52AM -0500, Jean-Philippe Ouellet wrote: On 12/20/12 3:53 AM, Jean-Philippe Ouellet wrote: and madvise() them to not be swapped out? Oops, I think I might have misinterpreted the meaning of MADV_WILLNEED. I think I meant mlock(). Why trying to be smarter than

Re: High performance IO (sendfile(), caching, and libev(ent))

2012-12-20 Thread Otto Moerbeek
On Thu, Dec 20, 2012 at 03:53:44AM -0500, Jean-Philippe Ouellet wrote: Hello, I'm trying to learn about writing high performance servers, and I have a few questions not clearly answered by any documentation I can find. I'm comfortable with select(), poll(), and kqueue(), but that only goes

Re: High performance IO (sendfile(), caching, and libev(ent))

2012-12-20 Thread Jean-Philippe Ouellet
On 12/20/12 4:20 AM, Otto Moerbeek wrote: On Thu, Dec 20, 2012 at 04:06:52AM -0500, Jean-Philippe Ouellet wrote: On 12/20/12 3:53 AM, Jean-Philippe Ouellet wrote: and madvise() them to not be swapped out? Oops, I think I might have misinterpreted the meaning of MADV_WILLNEED. I think I

Re: High performance IO (sendfile(), caching, and libev(ent))

2012-12-20 Thread Andres Perera
On Thu, Dec 20, 2012 at 4:23 AM, Jean-Philippe Ouellet jean-phili...@ouellet.biz wrote: Hello, I'm trying to learn about writing high performance servers, and I have a few questions not clearly answered by any documentation I can find. I'm comfortable with select(), poll(), and kqueue(), but

Re: High performance IO (sendfile(), caching, and libev(ent))

2012-12-20 Thread Tobias Ulmer
On Thu, Dec 20, 2012 at 04:26:48AM -0500, Jean-Philippe Ouellet wrote: On 12/20/12 4:20 AM, Otto Moerbeek wrote: On Thu, Dec 20, 2012 at 04:06:52AM -0500, Jean-Philippe Ouellet wrote: On 12/20/12 3:53 AM, Jean-Philippe Ouellet wrote: and madvise() them to not be swapped out? Oops, I

Re: High performance IO (sendfile(), caching, and libev(ent))

2012-12-20 Thread Andres Perera
On Thu, Dec 20, 2012 at 6:06 AM, Tobias Ulmer tobi...@tmux.org wrote: The file will be in the buffer cache. While it still takes a few in-memory copies (which is what sendfile saves you), this should be fast enough for most cases. If you keep the data in your address space, you save one

Re: High performance IO (sendfile(), caching, and libev(ent))

2012-12-20 Thread William Ahern
On Thu, Dec 20, 2012 at 03:53:44AM -0500, Jean-Philippe Ouellet wrote: Hello, I'm trying to learn about writing high performance servers, and I have a few questions not clearly answered by any documentation I can find. I'm comfortable with select(), poll(), and kqueue(), but that only goes