Date: Fri, 2 Feb 2001 09:18:23 +0800 From: "David Xu" <davidx@viasoft.com.cn> To: "Tony Finch" <dot@dotat.at> Cc: "Kris Kennaway" <kris@obsecurity.org>, "bsddiy" <bsddiy@163.net>, <freebsd-net@FreeBSD.ORG> Subject: Re: sendfile() Message-ID: <003801c08cb6$09f96650$6201a8c0@William> References: <1217774688.20010201133139@163.net> <20010201023825.A71975@xor.obsecurity.org> <20010201180010.Q70673@hand.dotat.at> <001d01c08cb1$9c445d80$6201a8c0@William> <20010202005018.Y70673@hand.dotat.at>
next in thread | previous in thread | raw e-mail | index | archive | help
I have looked into tcp_usrreq.c and it seems when TCP_NOPUSH is turned off,
the last data segment is not sent immediately, need to add a tcp_output call?
I am not certain, in tcp_ctloutput(so, opt), I think the code should like this:
case TCP_NOPUSH:
...
if (optval)
tp->t_flags |= opt;
else
{
tp->t_flags &= ~opt;
if (opt == TF_NOPUSH)
error = tcp_output(tp);
}
--
Regards,
David Xu
----- Original Message -----
From: "Tony Finch" <dot@dotat.at>
To: "David Xu" <davidx@viasoft.com.cn>
Cc: "Kris Kennaway" <kris@obsecurity.org>; "bsddiy" <bsddiy@163.net>; <freebsd-net@FreeBSD.ORG>
Sent: Friday, February 02, 2001 8:50 AM
Subject: Re: sendfile()
> David Xu <davidx@viasoft.com.cn> wrote:
> >
> >but as I know, it seems TCP_NOPUSH is mainly used for TTCP, right?
>
> That's what it was designed for.
>
> >the idea behind TCP_CORK is it buffers any small data segment user
> >program sending until these segments full fills a max TCP packet,
> >then the packet is sent,
>
> TCP_NOPUSH is the same
>
> >web servers always send many very small HTTP headers, cause lots of
> >small packets sent out, TCP_CORK can increase network performance.
>
> No, web servers are very careful to reduce the number of packets
> required for a response. TCP_CORK exists to avoid two bad packet
> boundaries per request: one between the header and the body, and one
> between the body and the next response. FreeBSD's sendfile allows you
> to easily optimise the beginning of the response; optimising the
> transition from one response to the next is harder.
>
> Tony.
> --
> f.a.n.finch fanf@covalent.net dot@dotat.at
> "If I didn't see it with my own eyes I would never have believed it!"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?003801c08cb6$09f96650$6201a8c0>
