Re: Update: Debox sendfile modifications

From: Igor Sysoev (is_at_rambler-co.ru)
Date: 11/10/03

  • Next message: M. Warner Losh: "Re: Driver question"
    Date: Mon, 10 Nov 2003 17:14:23 +0300 (MSK)
    To: John-Mark Gurney <gurney_j@efn.org>
    
    

    On Sun, 9 Nov 2003, John-Mark Gurney wrote:

    > Igor Sysoev wrote this message on Sun, Nov 09, 2003 at 15:16 +0300:

    > > > If you made this a fd transparent operation then I would agree with
    > > > it.
    > >
    > > The current sendfile() implementation works with sockets only.
    > > Well, I agree that such sendfile() implementation is a hack.
    > > Nowever this implementation is very usefull in the real world -
    > > it allows to minimize a data copy in http and ftp servers.
    > >
    > > I just could not figure to myself where can be usefull the
    > > high perfomance sendfile() to a pipe.
    >
    > It's not so much of how, but optimizing for the general case, not
    > the specific case. I was using pipes as an example, what about for
    > coping one fd to another? Right now cp will try to mmap a 16meg buffer,
    > and use that, if it fails, it falls back to a read/write loop.. why
    > not do something like copyfd that does it more optimally?
    >
    > > I think that it's better to leave sendfile() as a sending to a socket
    > > only hack. I believe that any sendfile() generalization (e.g. sending
    > > data from a socket to a file) is useless.
    >
    > oh? why do you think that is useless? What about all the applications
    > like ftp clients, and wget/fetch/curl that do it on a regular basis?

    To notice some perfomance impact of using sendfile() in cp, wget, etc
    I need to run simultaneously hundreds of these applications.
    To see the perfomance impact of using sendfile() in http or ftp server
    I need to serve hundreds of clients. The first case is too rare
    while the second one is common for the busy servers.

    Igor Sysoev
    http://sysoev.ru/en/

    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: M. Warner Losh: "Re: Driver question"

    Relevant Pages

    • Re: Update: Debox sendfile modifications
      ... > that says that sendfile() had started the reading a page. ... > a socket buffer space. ... When the page had been read this flag is reset. ...
      (freebsd-hackers)
    • Re: complement to sendfile()?
      ... My program receives data from the socket and writes it to a file -- with the ... Is there anything zero-copying like sendfile() for the socket->file direction? ... This is because network buffers can be made ...
      (freebsd-net)
    • Re: sendfile(2) SF_NOPUSH flag proposal
      ... >When I turn TCP_NOPUSH on just before sendfile() then it sends the header ... The last data in the send buffer may not comprise a complete frame so ... the socket will become writable, ... As long as SO_SNDLOWAT is at least one frame smaller than SO_SNDBUF, ...
      (freebsd-arch)
    • Re: Update: Debox sendfile modifications
      ... > I think it can done in the following way - a socket should have flag ... > that says that sendfile() had started the reading a page. ... When the page had been read this flag is reset. ...
      (freebsd-hackers)
    • Re: [ANN] socket_sendfile
      ... socket = TCPSocket.open host, port ... ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count); ... And has this to say about non-blocking sockets: ... When using a socket marked for non-blocking I/O, sendfile() may send ...
      (comp.lang.ruby)