This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: TCP/IP write() buffering question
- To: grante at visi dot com (Grant Edwards)
- Subject: Re: [ECOS] TCP/IP write() buffering question
- From: andrew dot lunn at ascom dot ch (Andrew Lunn)
- Date: Thu, 21 Sep 2000 15:09:00 +0200 (MET DST)
- Cc: ecos-discuss at sources dot redhat dot com
> The problem is that each JavaScript write() causes a write() on
> the socket, and the web page data is sent as a large number of
> Ethernet packets containing a small number of bytes of data
> each: 50+ packets for a total of about 1500 bytes. This is
> really killing the performance and results in a load time of 2
> seconds for a page that's less than 2K of HTML.
>
> Is there a way to get the stack to do more buffering of write()
> data so that the page goes out as fewer packets?
Is this a TCP stream of UDP? I know HTTP can use both. For UDP you
cannot do anything. Check if the push bit is set on the TCP
packet. Use tcpdump or something similar. Its possible to set the
socket into a mode where it disables its clumping together of
data. This is useful for interactive connections like Telnet, but not
so good for more bulk transfer such as this. See if the server is
doing a setsockopt with TCP_NODELAY. If so try disabling this call and
see if it makes any difference.
Andrew